net.sf.cpsolver.exam.model
Class ExamRoomPlacement

java.lang.Object
  extended by net.sf.cpsolver.exam.model.ExamRoomPlacement
All Implemented Interfaces:
Comparable

public class ExamRoomPlacement
extends Object
implements Comparable

Representation of a room placement of an exam. It contains a room ExamRoom and a penalty associated with a placement of an exam into the given room.

Version:
ExamTT 1.1 (Examination Timetabling)
Copyright (C) 2008 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

Constructor Summary
ExamRoomPlacement(ExamRoom room)
          Constructor
ExamRoomPlacement(ExamRoom room, int penalty)
          Constructor
ExamRoomPlacement(ExamRoom room, int penalty, int maxPenalty)
          Constructor
 
Method Summary
 int compareTo(Object o)
          Compare two room placements
 boolean equals(Object o)
          Compare two room placements for equality
 int getDistance(ExamRoomPlacement other)
          Room distance
 long getId()
          Examination room id
 int getMaxPenalty()
          Maximal penalty imposed of ExamRoom.getPenalty(ExamPeriod), i.e., a placement with greater penalty is not allowed to be made
 String getName()
          Examination room name
 int getPenalty()
          Penalty for assignment of an exam into this room Exam.getRoomPlacements()
 int getPenalty(ExamPeriod period)
          Penalty for assignment of an exam into this room Exam.getRoomPlacements() and the given examination period
 ExamRoom getRoom()
          Examination room
 int getSize(boolean altSeating)
          Room size
 int hashCode()
          Hash code
 boolean isAvailable(ExamPeriod period)
          Examination room availability
 void setMaxPenalty(int maxPenalty)
          Maximal penalty imposed of ExamRoom.getPenalty(ExamPeriod), i.e., a placement with greater penalty is not allowed to be made
 void setPenalty(int penalty)
          Penalty for assignment of an exam into this room Exam.getRoomPlacements()
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExamRoomPlacement

public ExamRoomPlacement(ExamRoom room)
Constructor

Parameters:
room - examination room

ExamRoomPlacement

public ExamRoomPlacement(ExamRoom room,
                         int penalty)
Constructor

Parameters:
room - examination room
penalty - penalty for using this room

ExamRoomPlacement

public ExamRoomPlacement(ExamRoom room,
                         int penalty,
                         int maxPenalty)
Constructor

Parameters:
room - examination room
penalty - penalty for using this room
maxPenalty - maximal penalty imposed of ExamRoom.getPenalty(ExamPeriod), i.e., a placement with greater penalty is not allowed to be made
Method Detail

getRoom

public ExamRoom getRoom()
Examination room


getId

public long getId()
Examination room id


getName

public String getName()
Examination room name


isAvailable

public boolean isAvailable(ExamPeriod period)
Examination room availability


getPenalty

public int getPenalty()
Penalty for assignment of an exam into this room Exam.getRoomPlacements()


getMaxPenalty

public int getMaxPenalty()
Maximal penalty imposed of ExamRoom.getPenalty(ExamPeriod), i.e., a placement with greater penalty is not allowed to be made


setPenalty

public void setPenalty(int penalty)
Penalty for assignment of an exam into this room Exam.getRoomPlacements()


setMaxPenalty

public void setMaxPenalty(int maxPenalty)
Maximal penalty imposed of ExamRoom.getPenalty(ExamPeriod), i.e., a placement with greater penalty is not allowed to be made


getPenalty

public int getPenalty(ExamPeriod period)
Penalty for assignment of an exam into this room Exam.getRoomPlacements() and the given examination period

Returns:
getPenalty() + ExamRoom.getPenalty(ExamPeriod)

getSize

public int getSize(boolean altSeating)
Room size

Parameters:
altSeating - examination seeting (pass Exam.hasAltSeating())
Returns:
room size or room alternative size, based on given seating

getDistance

public int getDistance(ExamRoomPlacement other)
Room distance

Returns:
appropriate ExamRoom.getDistance(ExamRoom)

hashCode

public int hashCode()
Hash code

Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Compare two room placements for equality

Overrides:
equals in class Object

compareTo

public int compareTo(Object o)
Compare two room placements

Specified by:
compareTo in interface Comparable