org.cpsolver.studentsct.model

## Class Student

- java.lang.Object
- - org.cpsolver.studentsct.model.Student

- All Implemented Interfaces:
    Comparable<Student>

      public class Student
      extends Object
      implements Comparable<Student>

  Representation of a student. Each student contains id, and a list of requests.
  Last-like semester students are mark as dummy. Dummy students have lower value and generally should not block "real" students from getting requested courses.
  Version:
    StudentSct 1.3 (Student Sectioning)
    Copyright (C) 2007 - 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/.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Student.StudentPriority` Student priority level.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Student(long id)` Constructor
    `Student(long id, boolean dummy)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canAssign(Assignment<Request,Enrollment> assignment, Request request)` True if the given request can be assigned to the student.
    `int` | `compareTo(Student s)`
    `int` | `countFreeTimeOverlaps(Enrollment enrollment)` Count number of free time slots overlapping with the given enrollment
    `int` | `countFreeTimeOverlaps(TimeLocation time)` Count number of free time slots overlapping with the given time
    `boolean` | `equals(Object object)` Compare two students for equality.
    `Set<String>` | `getAccommodations()` List student accommodations
    `List<Instructor>` | `getAdvisors()` List of student's advisors
    `List<AreaClassificationMajor>` | `getAreaClassificationMajors()` List of academic area, classification, and major codes (`AreaClassificationMajor`) for the given student
    `List<AreaClassificationMajor>` | `getAreaClassificationMinors()` List of academic area, classification, and minor codes (`AreaClassificationMajor`) for the given student
    `float` | `getAssignedCredit(Assignment<Request,Enrollment> assignment)` Return the number of assigned credits of the student
    `Long` | `getEmailTimeStamp()` Get last email time stamp (online sectioning only)
    `String` | `getExternalId()` Get student external id
    `List<StudentGroup>` | `getGroups()` List of student groups (`StudentGroup`) for the given student
    `long` | `getId()` Student unique id
    `List<LinkedSections>` | `getLinkedSections()` Linked sections of this student
    `float` | `getMaxCredit()` Get student max credit (`Float.MAX_VALUE` if not set) return student max credit
    `float` | `getMinCredit()` Get student min credit (0 if not set) return student min credit
    `String` | `getName()` Get student name
    `Student.StudentPriority` | `getPriority()` Student's priority.
    `List<Request>` | `getRequests()` Student's course and free time requests
    `String` | `getStatus()` Get student status (online sectioning only)
    `List<Unavailability>` | `getUnavailabilities()` List of student unavailabilities
    `boolean` | `hasAccommodation(String code)` Check if a student has given accommodation
    `boolean` | `hasCritical()` Deprecated.
    `boolean` | `hasCritical(Request.RequestPriority rp)` Has student any critical course requests?
    `int` | `hashCode()` Hash code (base only on student id)
    `boolean` | `hasMaxCredit()` True if student has max credit defined
    `boolean` | `hasMinCredit()` True if student has min credit defined
    `boolean` | `hasUnassignedCritical(Assignment<Request,Enrollment> assignment)` Deprecated.
    `boolean` | `hasUnassignedCritical(Assignment<Request,Enrollment> assignment, Request.RequestPriority rp)` Has student any unassigned critical course requests?
    `boolean` | `isAllowDisabled()` True if student can be enrolled in disabled sections, regardless if his/her reservations
    `boolean` | `isAvailable(Enrollment enrollment)` Check if student is available during the given enrollment
    `boolean` | `isAvailable(Section section)` Check if student is available during the given section
    `boolean` | `isComplete(Assignment<Request,Enrollment> assignment)` True if the student has assigned the desired number of requests (i.e., number of non-alternative course requests).
    `boolean` | `isDummy()` Student's dummy flag.
    `boolean` | `isNeedShortDistances()` Return true if the student needs short distances.
    `boolean` | `isPriority()` Deprecated.
    `int` | `nrAlternativeRequests()` Number of alternative requests
    `int` | `nrAssignedRequests(Assignment<Request,Enrollment> assignment)` Number of assigned COURSE requests
    `int` | `nrRequests()` Number of requests (alternative requests are ignored)
    `void` | `setAllowDisabled(boolean allowDisabled)` Set to true if student can be enrolled in disabled sections, regardless if his/her reservations
    `void` | `setDummy(boolean dummy)` Set student's dummy flag.
    `void` | `setEmailTimeStamp(Long emailTimeStamp)` Set last email time stamp
    `void` | `setExternalId(String externalId)` Set student external id
    `void` | `setId(long id)` Set student unique id
    `void` | `setMaxCredit(Float maxCredit)` Set student max credit (null if not set)
    `void` | `setMinCredit(Float maxCredit)` Set student min credit (null if not set)
    `void` | `setName(String name)` Set student name
    `void` | `setNeedShortDistances(boolean needShortDistances)` Set true if the student needs short distances.
    `void` | `setPriority(boolean priority)` Deprecated.
    `void` | `setPriority(Student.StudentPriority priority)` Set student's priority.
    `void` | `setStatus(String status)` Set student status
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Student

          public Student(long id)

      Constructor
      Parameters:
        `id` - student unique id

    - #### Student

          public Student(long id,
                         boolean dummy)

      Constructor
      Parameters:
        `id` - student unique id
        `dummy` - dummy flag

  - ### Method Detail

    - #### getId

          public long getId()

      Student unique id
      Returns:
        student unique id

    - #### setId

          public void setId(long id)

      Set student unique id
      Parameters:
        `id` - student unique id

    - #### getRequests

          public List<Request> getRequests()

      Student's course and free time requests
      Returns:
        student requests

    - #### nrRequests

          public int nrRequests()

      Number of requests (alternative requests are ignored)
      Returns:
        number of non alternative student requests

    - #### nrAlternativeRequests

          public int nrAlternativeRequests()

      Number of alternative requests
      Returns:
        number of alternative student requests

    - #### canAssign

          public boolean canAssign(Assignment<Request,Enrollment> assignment,
                                   Request request)

      True if the given request can be assigned to the student. A request cannot be assigned to a student when the student already has the desired number of requests assigned (i.e., number of non-alternative course requests).
      Parameters:
        `assignment` - current assignment
        `request` - given request of this student
      Returns:
        true if the given request can be assigned

    - #### isComplete

          public boolean isComplete(Assignment<Request,Enrollment> assignment)

      True if the student has assigned the desired number of requests (i.e., number of non-alternative course requests).
      Parameters:
        `assignment` - current assignment
      Returns:
        true if this student has a complete schedule

    - #### nrAssignedRequests

          public int nrAssignedRequests(Assignment<Request,Enrollment> assignment)

      Number of assigned COURSE requests
      Parameters:
        `assignment` - current assignment
      Returns:
        number of assigned course requests

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### isDummy

          public boolean isDummy()

      Student's dummy flag. Dummy students have lower value and generally should not block "real" students from getting requested courses.
      Returns:
        true if projected student

    - #### setDummy

          public void setDummy(boolean dummy)

      Set student's dummy flag. Dummy students have lower value and generally should not block "real" students from getting requested courses.
      Parameters:
        `dummy` - projected student

    - #### getPriority

          public Student.StudentPriority getPriority()

      Student's priority. Priority students are to be assigned first.
      Returns:
        student priority level

    - #### setPriority

          public void setPriority(Student.StudentPriority priority)

      Set student's priority. Priority students are to be assigned first.
      Parameters:
        `priority` - student priority level

    - #### setPriority

          @Deprecated
          public void setPriority(boolean priority)

      Deprecated.
      Set student's priority. Priority students are to be assigned first.
      Parameters:
        `priority` - true for priority student

    - #### isPriority

          @Deprecated
          public boolean isPriority()

      Deprecated.
      Student's priority. Priority students are to be assigned first.
      Returns:
        true if priority student

    - #### getGroups

          public List<StudentGroup> getGroups()

      List of student groups (`StudentGroup`) for the given student
      Returns:
        list of academic area abbreviation (group type) & group code pairs

    - #### getAccommodations

          public Set<String> getAccommodations()

      List student accommodations
      Returns:
        student accommodations

    - #### getAreaClassificationMajors

          public List<AreaClassificationMajor> getAreaClassificationMajors()

      List of academic area, classification, and major codes (`AreaClassificationMajor`) for the given student
      Returns:
        list of academic area, classification, and major codes

    - #### getAreaClassificationMinors

          public List<AreaClassificationMajor> getAreaClassificationMinors()

      List of academic area, classification, and minor codes (`AreaClassificationMajor`) for the given student
      Returns:
        list of academic area, classification, and minor codes

    - #### getAdvisors

          public List<Instructor> getAdvisors()

      List of student's advisors

    - #### equals

          public boolean equals(Object object)

      Compare two students for equality. Two students are considered equal if they have the same id.
      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Hash code (base only on student id)
      Overrides:
        `hashCode` in class `Object`

    - #### countFreeTimeOverlaps

          public int countFreeTimeOverlaps(Enrollment enrollment)

      Count number of free time slots overlapping with the given enrollment
      Parameters:
        `enrollment` - given enrollment
      Returns:
        number of slots overlapping with a free time request

    - #### countFreeTimeOverlaps

          public int countFreeTimeOverlaps(TimeLocation time)

      Count number of free time slots overlapping with the given time
      Parameters:
        `time` - given time
      Returns:
        number of time slots overlapping with a free time request

    - #### getExternalId

          public String getExternalId()

      Get student external id
      Returns:
        student external unique id

    - #### setExternalId

          public void setExternalId(String externalId)

      Set student external id
      Parameters:
        `externalId` - student external id

    - #### getName

          public String getName()

      Get student name
      Returns:
        student name

    - #### setName

          public void setName(String name)

      Set student name
      Parameters:
        `name` - student name

    - #### getLinkedSections

          public List<LinkedSections> getLinkedSections()

      Linked sections of this student
      Returns:
        linked sections of this student

    - #### getStatus

          public String getStatus()

      Get student status (online sectioning only)
      Returns:
        student sectioning status

    - #### setStatus

          public void setStatus(String status)

      Set student status
      Parameters:
        `status` - student sectioning status

    - #### getEmailTimeStamp

          public Long getEmailTimeStamp()

      Get last email time stamp (online sectioning only)
      Returns:
        student email time stamp

    - #### setEmailTimeStamp

          public void setEmailTimeStamp(Long emailTimeStamp)

      Set last email time stamp
      Parameters:
        `emailTimeStamp` - student email time stamp

    - #### compareTo

          public int compareTo(Student s)

      Specified by:
        `compareTo` in interface `Comparable<Student>`

    - #### getUnavailabilities

          public List<Unavailability> getUnavailabilities()

      List of student unavailabilities
      Returns:
        student unavailabilities

    - #### isAvailable

          public boolean isAvailable(Section section)

      Check if student is available during the given section
      Parameters:
        `section` - given section
      Returns:
        true, if available (the section cannot overlap and there is no overlapping unavailability that cannot overlap)

    - #### isAvailable

          public boolean isAvailable(Enrollment enrollment)

      Check if student is available during the given enrollment
      Parameters:
        `enrollment` - given enrollment
      Returns:
        true, if available

    - #### isNeedShortDistances

          public boolean isNeedShortDistances()

      Return true if the student needs short distances. A different distance conflict checking is employed for such students.
      Returns:
        true if the student needs short distances

    - #### setNeedShortDistances

          public void setNeedShortDistances(boolean needShortDistances)

      Set true if the student needs short distances. A different distance conflict checking is employed for such students.
      Parameters:
        `needShortDistances` - true if the student needs short distances (default is false)

    - #### isAllowDisabled

          public boolean isAllowDisabled()

      True if student can be enrolled in disabled sections, regardless if his/her reservations
      Returns:
        does this student allow for disabled sections

    - #### setAllowDisabled

          public void setAllowDisabled(boolean allowDisabled)

      Set to true if student can be enrolled in disabled sections, regardless if his/her reservations
      Parameters:
        `allowDisabled` - does this student allow for disabled sections

    - #### hasMinCredit

          public boolean hasMinCredit()

      True if student has min credit defined
      Returns:
        true if min credit is set

    - #### getMinCredit

          public float getMinCredit()

      Get student min credit (0 if not set) return student min credit

    - #### hasCritical

          @Deprecated
          public boolean hasCritical()

      Deprecated.
      Has student any critical course requests?
      Returns:
        true if a student has at least one course request that is marked as critical

    - #### hasCritical

          public boolean hasCritical(Request.RequestPriority rp)

      Has student any critical course requests?
      Returns:
        true if a student has at least one course request that is marked as critical

    - #### hasUnassignedCritical

          @Deprecated
          public boolean hasUnassignedCritical(Assignment<Request,Enrollment> assignment)

      Deprecated.
      Has student any unassigned critical course requests?
      Returns:
        true if a student has at least one not-alternative course request that is marked as critical and that is not assigned

    - #### hasUnassignedCritical

          public boolean hasUnassignedCritical(Assignment<Request,Enrollment> assignment,
                                               Request.RequestPriority rp)

      Has student any unassigned critical course requests?
      Returns:
        true if a student has at least one not-alternative course request that is marked as critical and that is not assigned

    - #### setMinCredit

          public void setMinCredit(Float maxCredit)

      Set student min credit (null if not set)
      Parameters:
        `maxCredit` - student min credit

    - #### hasMaxCredit

          public boolean hasMaxCredit()

      True if student has max credit defined
      Returns:
        true if max credit is set

    - #### getMaxCredit

          public float getMaxCredit()

      Get student max credit (`Float.MAX_VALUE` if not set) return student max credit

    - #### setMaxCredit

          public void setMaxCredit(Float maxCredit)

      Set student max credit (null if not set)
      Parameters:
        `maxCredit` - student max credit

    - #### getAssignedCredit

          public float getAssignedCredit(Assignment<Request,Enrollment> assignment)

      Return the number of assigned credits of the student
      Parameters:
        `assignment` - current assignment
      Returns:
        total assigned credit using `Enrollment.getCredit()`

    - #### hasAccommodation

          public boolean hasAccommodation(String code)

      Check if a student has given accommodation
      Parameters:
        `code` - accommodation reference code
      Returns:
        true if present