net.sf.cpsolver.coursett.model
Class Placement

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Value
      extended by net.sf.cpsolver.coursett.model.Placement
All Implemented Interfaces:
Comparable

public class Placement
extends Value

Placement (value).

It combines room and time location

Version:
CourseTT 1.1 (University Course Timetabling)
Copyright (C) 2006 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Field Summary
 
Fields inherited from class net.sf.cpsolver.ifs.model.Value
iValue
 
Constructor Summary
Placement(Lecture lecture, TimeLocation timeLocation, RoomLocation roomLocation)
          Constructor
Placement(Lecture lecture, TimeLocation timeLocation, Vector roomLocations)
           
 
Method Summary
 boolean canShareRooms(Placement other)
           
 boolean equals(Object object)
          By default, comparison is made on unique ids
 Object getAssignment()
           
 Long getAssignmentId()
           
 Vector getBuildingIds()
           
 int getCommitedConflicts()
           
static double getDistance(Placement p1, Placement p2)
          Distance between two placements
 String getLongName()
           
 int getMaxSpreadPenalty()
           
 String getName()
          Values name -- for printing purposes (E.g., Monday 7:30)
 String getNotValidReason()
           
 int getNrRooms()
           
 Vector getRoomIds()
           
 RoomLocation getRoomLocation()
          Room location
 RoomLocation getRoomLocation(Long roomId)
           
 Vector getRoomLocations()
          Room locations (multi-room placement)
 String getRoomName(String delim)
           
 Vector getRoomNames()
           
 int getRoomPreference()
           
 Vector getRoomPrefs()
           
 int getRoomSize()
           
 int getSpreadPenalty()
           
 TimeLocation getTimeLocation()
          Time location
 int getTooBigRoomPreference()
           
 int hashCode()
           
 boolean hasRoomLocation(Long roomId)
           
 boolean isHard()
           
 boolean isMultiRoom()
           
 boolean isValid()
           
 int minRoomSize()
           
 int nrDifferentBuildings(Placement placement)
           
 int nrDifferentRooms(Placement placement)
           
 int nrUselessHalfHours()
           
 boolean sameRooms(Placement placement)
           
 boolean sameTime(Placement placement)
           
 void setAssignment(Object assignment)
           
 void setAssignmentId(Long assignmentId)
           
 boolean shareRooms(Placement placement)
           
 int sumRoomPreference()
           
 double toDouble()
          Dobouble representaion.
 String toString()
           
 
Methods inherited from class net.sf.cpsolver.ifs.model.Value
assigned, compareTo, conflicts, countAssignments, getDescription, getExtra, getId, isConsistent, lastAssignmentIteration, lastUnassignmentIteration, setExtra, setVariable, unassigned, valueEquals, variable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Placement

public Placement(Lecture lecture,
                 TimeLocation timeLocation,
                 RoomLocation roomLocation)
Constructor

Parameters:
lecture - lecture
timeLocation - time location
roomLocation - room location

Placement

public Placement(Lecture lecture,
                 TimeLocation timeLocation,
                 Vector roomLocations)
Method Detail

getTimeLocation

public TimeLocation getTimeLocation()
Time location


getRoomLocation

public RoomLocation getRoomLocation()
Room location


getRoomLocations

public Vector getRoomLocations()
Room locations (multi-room placement)


getBuildingIds

public Vector getBuildingIds()

getRoomIds

public Vector getRoomIds()

getRoomNames

public Vector getRoomNames()

getRoomPrefs

public Vector getRoomPrefs()

isMultiRoom

public boolean isMultiRoom()

getRoomLocation

public RoomLocation getRoomLocation(Long roomId)

hasRoomLocation

public boolean hasRoomLocation(Long roomId)

getRoomName

public String getRoomName(String delim)

getName

public String getName()
Description copied from class: Value
Values name -- for printing purposes (E.g., Monday 7:30)

Overrides:
getName in class Value

getLongName

public String getLongName()

sameRooms

public boolean sameRooms(Placement placement)

shareRooms

public boolean shareRooms(Placement placement)

nrDifferentRooms

public int nrDifferentRooms(Placement placement)

nrDifferentBuildings

public int nrDifferentBuildings(Placement placement)

sumRoomPreference

public int sumRoomPreference()

getRoomPreference

public int getRoomPreference()

getRoomSize

public int getRoomSize()

minRoomSize

public int minRoomSize()

getTooBigRoomPreference

public int getTooBigRoomPreference()

nrUselessHalfHours

public int nrUselessHalfHours()

isHard

public boolean isHard()

sameTime

public boolean sameTime(Placement placement)

equals

public boolean equals(Object object)
Description copied from class: Value
By default, comparison is made on unique ids

Overrides:
equals in class Value

hashCode

public int hashCode()
Overrides:
hashCode in class Value

toString

public String toString()
Overrides:
toString in class Value

getDistance

public static double getDistance(Placement p1,
                                 Placement p2)
Distance between two placements


getCommitedConflicts

public int getCommitedConflicts()

getAssignmentId

public Long getAssignmentId()

setAssignmentId

public void setAssignmentId(Long assignmentId)

canShareRooms

public boolean canShareRooms(Placement other)

isValid

public boolean isValid()

getNotValidReason

public String getNotValidReason()

getNrRooms

public int getNrRooms()

getSpreadPenalty

public int getSpreadPenalty()

getMaxSpreadPenalty

public int getMaxSpreadPenalty()

toDouble

public double toDouble()
Description copied from class: Value
Dobouble representaion. This allows us to have generic optimization criteria. The task is than to minimize total value of assigned variables of a solution.

Overrides:
toDouble in class Value

getAssignment

public Object getAssignment()

setAssignment

public void setAssignment(Object assignment)