org.cpsolver.coursett.model

## Class RoomSharingModel

- java.lang.Object
- - org.cpsolver.coursett.model.RoomSharingModel

-     public class RoomSharingModel
      extends Object

  Room availability model.
  Version:
    CourseTT 1.3 (University Course Timetabling)
    Copyright (C) 2006 - 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/.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Long[]` | `iDepartmentIds`
    `protected HashMap<Long,Integer>` | `iDepartmentIdx`
    `char` | `iFreeForAllPrefChar`
    `char` | `iNotAvailablePrefChar`
    `protected Long[][]` | `iPreference`
    `protected int` | `iStep`
    `static Long` | `sDefaultPref`
    `static char` | `sDefaultPrefChar`
    `static Long` | `sFreeForAllPref`
    `static char` | `sFreeForAllPrefChar`
    `static Long` | `sNotAvailablePref`
    `static char` | `sNotAvailablePrefChar`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `RoomSharingModel()`
    `protected` | `RoomSharingModel(int step)`
    `` | `RoomSharingModel(int step, Long[] managerIds, String pattern, Character freeForAllPrefChar, Character notAvailablePrefChar)`
    `` | `RoomSharingModel(int step, Map<Character,Long> managerIds, String pattern, Character freeForAllPrefChar, Character notAvailablePrefChar)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Long` | `getDepartmentId(char ch)`
    `Long` | `getDepartmentId(int slot)`
    `Long` | `getDepartmentId(int day, int time)`
    `Long[]` | `getDepartmentIds()`
    `char` | `getFreeForAllPrefChar()`
    `char` | `getCharacter(Long departmentId)`
    `int` | `getIndex(Long departmentId)`
    `char` | `getNotAvailablePrefChar()`
    `int` | `getNrDays()`
    `int` | `getNrDepartments()`
    `int` | `getNrTimes()`
    `String` | `getPreferences()`
    `int` | `getStep()`
    `boolean` | `isAvailable(TimeLocation timeLocation, Long departmentId)`
    `boolean` | `isFreeForAll(int slot)`
    `boolean` | `isFreeForAll(int day, int time)`
    `boolean` | `isNotAvailable(int slot)`
    `boolean` | `isNotAvailable(int day, int time)`
    `void` | `setFreeForAllPrefChar(char c)`
    `void` | `setNotAvailablePrefChar(char c)`
    `void` | `setPreferences(String pattern)`

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

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

- - ### Field Detail

    - #### iStep

          protected int iStep

    - #### iPreference

          protected Long[][] iPreference

    - #### iDepartmentIds

          protected Long[] iDepartmentIds

    - #### iDepartmentIdx

          protected HashMap<Long,Integer> iDepartmentIdx

    - #### sFreeForAllPref

          public static Long sFreeForAllPref

    - #### sNotAvailablePref

          public static Long sNotAvailablePref

    - #### sFreeForAllPrefChar

          public static char sFreeForAllPrefChar

    - #### sNotAvailablePrefChar

          public static char sNotAvailablePrefChar

    - #### sDefaultPref

          public static Long sDefaultPref

    - #### sDefaultPrefChar

          public static char sDefaultPrefChar

    - #### iFreeForAllPrefChar

          public char iFreeForAllPrefChar

    - #### iNotAvailablePrefChar

          public char iNotAvailablePrefChar

  - ### Constructor Detail

    - #### RoomSharingModel

          protected RoomSharingModel(int step)

    - #### RoomSharingModel

          protected RoomSharingModel()

    - #### RoomSharingModel

          public RoomSharingModel(int step,
                                  Map<Character,Long> managerIds,
                                  String pattern,
                                  Character freeForAllPrefChar,
                                  Character notAvailablePrefChar)

    - #### RoomSharingModel

          public RoomSharingModel(int step,
                                  Long[] managerIds,
                                  String pattern,
                                  Character freeForAllPrefChar,
                                  Character notAvailablePrefChar)

  - ### Method Detail

    - #### getFreeForAllPrefChar

          public char getFreeForAllPrefChar()

    - #### setFreeForAllPrefChar

          public void setFreeForAllPrefChar(char c)

    - #### getNotAvailablePrefChar

          public char getNotAvailablePrefChar()

    - #### setNotAvailablePrefChar

          public void setNotAvailablePrefChar(char c)

    - #### isFreeForAll

          public boolean isFreeForAll(int day,
                                      int time)

    - #### isFreeForAll

          public boolean isFreeForAll(int slot)

    - #### isNotAvailable

          public boolean isNotAvailable(int day,
                                        int time)

    - #### isNotAvailable

          public boolean isNotAvailable(int slot)

    - #### isAvailable

          public boolean isAvailable(TimeLocation timeLocation,
                                     Long departmentId)

    - #### getDepartmentId

          public Long getDepartmentId(int day,
                                      int time)

    - #### getDepartmentId

          public Long getDepartmentId(int slot)

    - #### getDepartmentIds

          public Long[] getDepartmentIds()

    - #### getNrDepartments

          public int getNrDepartments()

    - #### getIndex

          public int getIndex(Long departmentId)

    - #### getCharacter

          public char getCharacter(Long departmentId)

    - #### getDepartmentId

          public Long getDepartmentId(char ch)

    - #### getPreferences

          public String getPreferences()

    - #### setPreferences

          public void setPreferences(String pattern)

    - #### getNrDays

          public int getNrDays()

    - #### getNrTimes

          public int getNrTimes()

    - #### getStep

          public int getStep()