org.cpsolver.exam.model

## Class ExamRoomSharing

- java.lang.Object
- - org.cpsolver.exam.model.ExamRoomSharing

- Direct Known Subclasses:
    PredefinedExamRoomSharing, SimpleExamRoomSharing

      public abstract class ExamRoomSharing
      extends Object

  Abstract room sharing model. Defines when and under what conditions two or more exams can share a room.
  Version:
    ExamTT 1.3 (Examination Timetabling)
    Copyright (C) 2008 - 2014 Tomáš Müller
    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

    Constructors
    Constructor and Description
    `ExamRoomSharing(Model<Exam,ExamPlacement> model, DataProperties config)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract boolean` | `canShareRoom(Exam x1, Exam x2)` True if given two exams can share a room
    `void` | `computeConflicts(Exam exam, Collection<ExamPlacement> other, ExamRoom room, Set<ExamPlacement> conflicts)` Compute conflicting placement for the case when a given examination needs to be placed in the same room at the same period as the other examinations
    `void` | `computeConflicts(ExamPlacement exam, Collection<ExamPlacement> other, ExamRoom room, Set<ExamPlacement> conflicts)` Compute conflicting placement for the case when a given examination needs to be placed in the same room at the same period as the other examinations
    `boolean` | `inConflict(Exam exam, Collection<ExamPlacement> other, ExamRoom room)` True if given examination can not be placed in the same room at the same period as the other examinations
    `boolean` | `inConflict(ExamPlacement exam, Collection<ExamPlacement> other, ExamRoom room)` True if given examination can not be placed in the same room at the same period as the other examinations
    `void` | `load(Exam exam, Element element)` Load sharing information (if needed) for a given exam
    `void` | `save(Exam exam, Element element, IdConvertor idConvertor)` Save sharing information (if needed) for a given exam

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExamRoomSharing

          public ExamRoomSharing(Model<Exam,ExamPlacement> model,
                                 DataProperties config)

  - ### Method Detail

    - #### inConflict

          public boolean inConflict(ExamPlacement exam,
                                    Collection<ExamPlacement> other,
                                    ExamRoom room)

      True if given examination can not be placed in the same room at the same period as the other examinations
      Parameters:
        `exam` - examination placement in question
        `other` - exams currently assigned in the room at the requested period
        `room` - examination room in questions
      Returns:
        true if there is a conflict

    - #### inConflict

          public boolean inConflict(Exam exam,
                                    Collection<ExamPlacement> other,
                                    ExamRoom room)

      True if given examination can not be placed in the same room at the same period as the other examinations
      Parameters:
        `exam` - examination in question
        `other` - exams currently assigned in the room at the requested period
        `room` - examination room in questions
      Returns:
        true if there is a conflict

    - #### computeConflicts

          public void computeConflicts(ExamPlacement exam,
                                       Collection<ExamPlacement> other,
                                       ExamRoom room,
                                       Set<ExamPlacement> conflicts)

      Compute conflicting placement for the case when a given examination needs to be placed in the same room at the same period as the other examinations
      Parameters:
        `exam` - examination placement in question
        `other` - exams currently assigned in the room at the requested period
        `room` - examination room in questions
        `conflicts` - set of conflicting assignments

    - #### computeConflicts

          public void computeConflicts(Exam exam,
                                       Collection<ExamPlacement> other,
                                       ExamRoom room,
                                       Set<ExamPlacement> conflicts)

      Compute conflicting placement for the case when a given examination needs to be placed in the same room at the same period as the other examinations
      Parameters:
        `exam` - examination in question
        `other` - exams currently assigned in the room at the requested period
        `room` - examination room in questions
        `conflicts` - set of conflicting assignments

    - #### canShareRoom

          public abstract boolean canShareRoom(Exam x1,
                                               Exam x2)

      True if given two exams can share a room
      Parameters:
        `x1` - first exam
        `x2` - second exam
      Returns:
        true if the two exams can share a room

    - #### save

          public void save(Exam exam,
                           Element element,
                           IdConvertor idConvertor)

      Save sharing information (if needed) for a given exam
      Parameters:
        `exam` - exam in question
        `element` - XML exam element to include sharing information
        `idConvertor` - id converter

    - #### load

          public void load(Exam exam,
                           Element element)

      Load sharing information (if needed) for a given exam
      Parameters:
        `exam` - exam in question
        `element` - XML exam element including sharing information