net.sf.cpsolver.exam.model
Class PredefinedExamRoomSharing

java.lang.Object
  extended by net.sf.cpsolver.exam.model.ExamRoomSharing
      extended by net.sf.cpsolver.exam.model.PredefinedExamRoomSharing

public class PredefinedExamRoomSharing
extends ExamRoomSharing

Room sharing model based on a pre-defined list of examination pairs. The relation needs to be populated using addPair(Exam, Exam) and it is persisted with the solution XML (see ExamModel.save(), canShareRoom element for each exam containing a comma separated list of exam ids).

Version:
ExamTT 1.2 (Examination Timetabling)
Copyright (C) 2008 - 2012 Tomas Muller
muller@unitime.org
http://muller.unitime.org

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 3 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 see http://www.gnu.org/licenses/.

Constructor Summary
PredefinedExamRoomSharing(Model<Exam,ExamPlacement> model, DataProperties config)
           
 
Method Summary
 void addPair(Exam x1, Exam x2)
          Add a pair of exams that are allowed to share a room
 void addPair(Long examId1, Long examId2)
          Add a pair of exams that are allowed to share a room
 boolean canShareRoom(Exam x1, Exam x2)
          True if given two exams can share a room
 void clear()
          Clear examination pairs
 void load(Exam exam, org.dom4j.Element element)
          Load sharing information (if needed) for a given exam
 void save(Exam exam, org.dom4j.Element element, IdConvertor idConvertor)
          Save sharing information (if needed) for a given exam
 
Methods inherited from class net.sf.cpsolver.exam.model.ExamRoomSharing
computeConflicts, computeConflicts, inConflict, inConflict
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PredefinedExamRoomSharing

public PredefinedExamRoomSharing(Model<Exam,ExamPlacement> model,
                                 DataProperties config)
Method Detail

canShareRoom

public boolean canShareRoom(Exam x1,
                            Exam x2)
Description copied from class: ExamRoomSharing
True if given two exams can share a room

Specified by:
canShareRoom in class ExamRoomSharing

addPair

public void addPair(Exam x1,
                    Exam x2)
Add a pair of exams that are allowed to share a room


addPair

public void addPair(Long examId1,
                    Long examId2)
Add a pair of exams that are allowed to share a room


clear

public void clear()
Clear examination pairs


save

public void save(Exam exam,
                 org.dom4j.Element element,
                 IdConvertor idConvertor)
Description copied from class: ExamRoomSharing
Save sharing information (if needed) for a given exam

Overrides:
save in class ExamRoomSharing

load

public void load(Exam exam,
                 org.dom4j.Element element)
Description copied from class: ExamRoomSharing
Load sharing information (if needed) for a given exam

Overrides:
load in class ExamRoomSharing


Copyright © 2014 UniTime LLC. All Rights Reserved.