net.sf.cpsolver.exam.model
Class ExamPeriodPlacement

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

public class ExamPeriodPlacement
extends Object
implements Comparable

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

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
ExamPeriodPlacement(ExamPeriod period, int penalty)
          Constructor
 
Method Summary
 int compareTo(Object o)
          Compare two period placements
 boolean equals(Object o)
          Compare two room placements for equality
 Long getId()
          Examination period id
 int getIndex()
          Examination period index
 int getPenalty()
          Examination period penalty (for an assignment of this period to the given exam Exam.getPeriodPlacements())
 ExamPeriod getPeriod()
          Examination period
 int hashCode()
          Hash code
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExamPeriodPlacement

public ExamPeriodPlacement(ExamPeriod period,
                           int penalty)
Constructor

Parameters:
period - examination period that is available for an exam and that is of enough length
penalty - period penalty for given exam
Method Detail

getPeriod

public ExamPeriod getPeriod()
Examination period


getId

public Long getId()
Examination period id


getIndex

public int getIndex()
Examination period index


getPenalty

public int getPenalty()
Examination period penalty (for an assignment of this period to the given exam Exam.getPeriodPlacements())

Returns:
given penalty plus global period penalty ExamPeriod.getPenalty()

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 period placements

Specified by:
compareTo in interface Comparable