net.sf.cpsolver.coursett.model
Class RoomSharingModel

java.lang.Object
  extended by net.sf.cpsolver.coursett.model.RoomSharingModel

public class RoomSharingModel
extends Object

Room availability model.

Version:
CourseTT 1.1 (University Course Timetabling)
Copyright (C) 2006 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

Field Summary
protected  Long[] iDepartmentIds
           
protected  Hashtable iDepartmentIdx
           
protected  Long[][] iPreference
           
static Long sDefaultPref
           
static char sDefaultPrefChar
           
static Long sFreeForAllPref
           
static char sFreeForAllPrefChar
           
static Long sNotAvailablePref
           
static char sNotAvailablePrefChar
           
 
Constructor Summary
protected RoomSharingModel()
           
  RoomSharingModel(Long[] managerIds, String pattern)
           
 
Method Summary
 Long getDepartmentId(int slot)
           
 Long getDepartmentId(int day, int time)
           
 Long[] getDepartmentIds()
           
 int getIndex(Long departmentId)
           
 int getNrDays()
           
 int getNrDepartments()
           
 int getNrTimes()
           
 String getPreferences()
           
 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 setPreferences(String pattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iPreference

protected Long[][] iPreference

iDepartmentIds

protected Long[] iDepartmentIds

iDepartmentIdx

protected Hashtable 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
Constructor Detail

RoomSharingModel

protected RoomSharingModel()

RoomSharingModel

public RoomSharingModel(Long[] managerIds,
                        String pattern)
Method Detail

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)

getPreferences

public String getPreferences()

setPreferences

public void setPreferences(String pattern)

getNrDays

public int getNrDays()

getNrTimes

public int getNrTimes()