net.sf.cpsolver.coursett.model
Class TimeLocation

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

public class TimeLocation
extends Object

Time part of placement.

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

Nested Class Summary
static interface TimeLocation.IntEnumeration
          Integer enumeration
 
Constructor Summary
TimeLocation(int dayCode, int startTime, int length, int pref, double normPref, Long datePatternId, String datePatternName, BitSet weekCode, int breakTime)
          Constructor
 
Method Summary
 boolean equals(Object o)
           
 int getBreakTime()
           
 Long getDatePatternId()
           
 String getDatePatternName()
           
 int getDayCode()
          Days (combination of 1 for Monday, 2 for Tuesday, ...)
 String getDayHeader()
          Days for printing purposes
 TimeLocation.IntEnumeration getDays()
          Days
 int[] getDaysArray()
           
 String getEndTimeHeader()
          End time for printing purposes
 String getEndTimeHeaderNoAdj()
          End time for printing purposes
 int getLength()
          Length
 String getLongName()
           
 String getLongNameNoAdj()
           
 String getName()
          Text representation
 double getNormalizedPreference()
          Normalized preference
 int getNrMeetings()
          Number of meetings
 int getNrSlotsPerMeeting()
          Length
 int getNrWeeks()
           
 int getNrWeeks(int startDay, int endDay)
           
 int getPreference()
          Preference
 TimeLocation.IntEnumeration getSlots()
          Used slots
 int getStartSlot()
          Start slot
 TimeLocation.IntEnumeration getStartSlots()
          Used start slots (for each meeting)
 String getStartTimeHeader()
          Start time for printing purposes
 Long getTimePatternId()
          Time pattern model (can be null)
 BitSet getWeekCode()
           
 boolean hasDay(int day)
           
 int hashCode()
           
 boolean hasIntersection(TimeLocation anotherLocation)
          true if overlap
 int nrSharedDays(TimeLocation anotherLocation)
          number of overlapping days
 int nrSharedHours(TimeLocation anotherLocation)
          number of overlapping days
 void setDatePattern(Long datePatternId, String datePatternName, BitSet weekCode)
           
 void setNormalizedPreference(double normalizedPreference)
           
 void setPreference(int preference)
           
 void setTimePatternId(Long timePatternId)
           
 boolean shareDays(TimeLocation anotherLocation)
          true if days overlap
 boolean shareHours(TimeLocation anotherLocation)
          true if hours overlap
 boolean shareWeeks(BitSet weekCode)
          true if weeks overlap
 boolean shareWeeks(TimeLocation anotherLocation)
          true if weeks overlap
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeLocation

public TimeLocation(int dayCode,
                    int startTime,
                    int length,
                    int pref,
                    double normPref,
                    Long datePatternId,
                    String datePatternName,
                    BitSet weekCode,
                    int breakTime)
Constructor

Parameters:
dayCode - days (combination of 1 for Monday, 2 for Tuesday, ...)
startTime - start slot
length - number of slots
pref - time preference
Method Detail

getNrMeetings

public int getNrMeetings()
Number of meetings


getBreakTime

public int getBreakTime()

getDayCode

public int getDayCode()
Days (combination of 1 for Monday, 2 for Tuesday, ...)


getDayHeader

public String getDayHeader()
Days for printing purposes


getStartTimeHeader

public String getStartTimeHeader()
Start time for printing purposes


getEndTimeHeader

public String getEndTimeHeader()
End time for printing purposes


getEndTimeHeaderNoAdj

public String getEndTimeHeaderNoAdj()
End time for printing purposes


getStartSlot

public int getStartSlot()
Start slot


shareDays

public boolean shareDays(TimeLocation anotherLocation)
true if days overlap


nrSharedDays

public int nrSharedDays(TimeLocation anotherLocation)
number of overlapping days


shareHours

public boolean shareHours(TimeLocation anotherLocation)
true if hours overlap


nrSharedHours

public int nrSharedHours(TimeLocation anotherLocation)
number of overlapping days


shareWeeks

public boolean shareWeeks(TimeLocation anotherLocation)
true if weeks overlap


shareWeeks

public boolean shareWeeks(BitSet weekCode)
true if weeks overlap


hasDay

public boolean hasDay(int day)

hasIntersection

public boolean hasIntersection(TimeLocation anotherLocation)
true if overlap


getSlots

public TimeLocation.IntEnumeration getSlots()
Used slots


getStartSlots

public TimeLocation.IntEnumeration getStartSlots()
Used start slots (for each meeting)


getDays

public TimeLocation.IntEnumeration getDays()
Days


getDaysArray

public int[] getDaysArray()

getName

public String getName()
Text representation


getLongName

public String getLongName()

getLongNameNoAdj

public String getLongNameNoAdj()

getPreference

public int getPreference()
Preference


setPreference

public void setPreference(int preference)

getLength

public int getLength()
Length


getNrSlotsPerMeeting

public int getNrSlotsPerMeeting()
Length


getNormalizedPreference

public double getNormalizedPreference()
Normalized preference


setNormalizedPreference

public void setNormalizedPreference(double normalizedPreference)

getTimePatternId

public Long getTimePatternId()
Time pattern model (can be null)


getDatePatternId

public Long getDatePatternId()

setTimePatternId

public void setTimePatternId(Long timePatternId)

getWeekCode

public BitSet getWeekCode()

getDatePatternName

public String getDatePatternName()

setDatePattern

public void setDatePattern(Long datePatternId,
                           String datePatternName,
                           BitSet weekCode)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getNrWeeks

public int getNrWeeks()

getNrWeeks

public int getNrWeeks(int startDay,
                      int endDay)