net.sf.cpsolver.studentsct.model
Class Subpart

java.lang.Object
  extended by net.sf.cpsolver.studentsct.model.Subpart
All Implemented Interfaces:
Comparable<Subpart>

public class Subpart
extends Object
implements Comparable<Subpart>

Representation of a scheduling subpart. Each scheduling subpart contains id, instructional type, name, instructional offering configuration, and a list of sections. Optionally, parent-child relation between subparts can be defined.

Version:
StudentSct 1.2 (Student Sectioning)
Copyright (C) 2007 - 2010 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
Subpart(long id, String itype, String name, Config config, Subpart parent)
          Constructor
 
Method Summary
 void clearReservationCache()
          Clear reservation information that was cached on this subpart or below
 int compareTo(Subpart s)
          Compare two subparts: put parents first, use ids if there is no parent-child relation
 boolean equals(Object o)
           
 List<Subpart> getChildren()
          Return children subparts
 Set<Choice> getChoices()
          List of available choices of the sections of this subpart.
 Config getConfig()
          Instructional offering configuration to which this subpart belongs
 String getCredit()
          Get credit (Online Student Scheduling only)
 long getId()
          Subpart id
 String getInstructionalType()
          Instructional type, e.g., Lecture, Recitation or Laboratory
 int getLimit()
          Sum of the section limits (unlimited, if one or more sections are unlimited)
 double getMaxPenalty()
          Maximal penalty from Section.getPenalty()
 double getMinPenalty()
          Minimal penalty from Section.getPenalty()
 String getName()
          Subpart name
 Subpart getParent()
          Parent subpart, if parent-child relation is defined between subparts
 List<Reservation> getSectionReservations()
          Get reservations that require sections of this subpart
 List<Section> getSections()
          List of sections
 int hashCode()
           
 boolean isAllowOverlap()
          Return true if overlaps are allowed, but the number of overlapping slots should be minimized.
 boolean isParentOf(Subpart subpart)
          True, if this subpart is parent (or parent of a parent etc.) of the given subpart
 void setAllowOverlap(boolean allowOverlap)
          Set to true if overlaps are allowed, but the number of overlapping slots should be minimized (defaults to false).
 void setCredit(String credit)
          Set credit (Online Student Scheduling only)
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Subpart

public Subpart(long id,
               String itype,
               String name,
               Config config,
               Subpart parent)
Constructor

Parameters:
id - scheduling subpart unique id
itype - instructional type
name - subpart name
config - instructional offering configuration to which this subpart belongs
parent - parent subpart, if parent-child relation is defined between subparts
Method Detail

getId

public long getId()
Subpart id


getInstructionalType

public String getInstructionalType()
Instructional type, e.g., Lecture, Recitation or Laboratory


getName

public String getName()
Subpart name


getConfig

public Config getConfig()
Instructional offering configuration to which this subpart belongs


getSections

public List<Section> getSections()
List of sections


getParent

public Subpart getParent()
Parent subpart, if parent-child relation is defined between subparts


toString

public String toString()
Overrides:
toString in class Object

isParentOf

public boolean isParentOf(Subpart subpart)
True, if this subpart is parent (or parent of a parent etc.) of the given subpart


compareTo

public int compareTo(Subpart s)
Compare two subparts: put parents first, use ids if there is no parent-child relation

Specified by:
compareTo in interface Comparable<Subpart>

getChoices

public Set<Choice> getChoices()
List of available choices of the sections of this subpart.


getMinPenalty

public double getMinPenalty()
Minimal penalty from Section.getPenalty()


getMaxPenalty

public double getMaxPenalty()
Maximal penalty from Section.getPenalty()


getChildren

public List<Subpart> getChildren()
Return children subparts


isAllowOverlap

public boolean isAllowOverlap()
Return true if overlaps are allowed, but the number of overlapping slots should be minimized.


setAllowOverlap

public void setAllowOverlap(boolean allowOverlap)
Set to true if overlaps are allowed, but the number of overlapping slots should be minimized (defaults to false).


getSectionReservations

public List<Reservation> getSectionReservations()
Get reservations that require sections of this subpart


clearReservationCache

public void clearReservationCache()
Clear reservation information that was cached on this subpart or below


getLimit

public int getLimit()
Sum of the section limits (unlimited, if one or more sections are unlimited)


equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setCredit

public void setCredit(String credit)
Set credit (Online Student Scheduling only)


getCredit

public String getCredit()
Get credit (Online Student Scheduling only)



Copyright © 2014 UniTime LLC. All Rights Reserved.