org.cpsolver.instructor.model

## Class TeachingRequest.Variable

- java.lang.Object
- - org.cpsolver.ifs.model.Variable<TeachingRequest.Variable,TeachingAssignment>
  - - org.cpsolver.instructor.model.TeachingRequest.Variable

- All Implemented Interfaces:
    Comparable<TeachingRequest.Variable>
  Enclosing class:
    TeachingRequest

      public class TeachingRequest.Variable
      extends Variable<TeachingRequest.Variable,TeachingAssignment>

  Single instructor assignment to this teaching request

- - ### Field Summary

    - ### Fields inherited from class org.cpsolver.ifs.model.Variable

      `iId, iValue`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Variable(int index)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `Course` | `getCourse()` Course of the request that was provided in the constructor
    `int` | `getInstructorIndex()` Instructor index that was provided in the constructor
    `String` | `getName()` Variable's name -- for printing purposes
    `TeachingRequest` | `getRequest()` Teaching request for this variable
    `List<Section>` | `getSections()` Sections of the request that was provided in the constructor
    `int` | `hashCode()`
    `List<TeachingAssignment>` | `values(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment)` Variable's domain
    `void` | `variableAssigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment, long iteration, TeachingAssignment ta)` A value was assigned to this variable
    `void` | `variableUnassigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment, long iteration, TeachingAssignment ta)` A value was unassigned from this variable

    - ### Methods inherited from class org.cpsolver.ifs.model.Variable

      `addContstraint, addVariableListener, assign, compareTo, constraints, constraintVariables, getAssignment, getAssignment, getAssignments, getBestAssignment, getBestAssignmentIteration, getDescription, getExtra, getId, getIndex, getInitialAssignment, getLastIteration, getModel, getVariableListeners, hardConstraints, hasAssignment, hasAssignment, hasInitialAssignment, hasValues, removeContstraint, removeInitialValue, removeValue, removeVariableListener, setAssignment, setBestAssignment, setExtra, setIndex, setInitialAssignment, setLastIteration, setModel, setValues, softConstraints, toString, unassign, values`

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

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

- - ### Constructor Detail

    - #### Variable

          public Variable(int index)

      Constructor
      Parameters:
        `index` - instructor index (if a class can be taught by multiple instructors, the index identifies the particular request)

  - ### Method Detail

    - #### getInstructorIndex

          public int getInstructorIndex()

      Instructor index that was provided in the constructor
      Returns:
        instructor index

    - #### getRequest

          public TeachingRequest getRequest()

      Teaching request for this variable
      Returns:
        teaching request

    - #### getCourse

          public Course getCourse()

      Course of the request that was provided in the constructor
      Returns:
        course of the request

    - #### getSections

          public List<Section> getSections()

      Sections of the request that was provided in the constructor
      Returns:
        sections of the request

    - #### values

          public List<TeachingAssignment> values(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment)

      Description copied from class: `Variable`
      Variable's domain
      Overrides:
        `values` in class `Variable<TeachingRequest.Variable,TeachingAssignment>`
      Parameters:
        `assignment` - current assignment (if the domain is dependent on the current assignment)
      Returns:
        all possible values of this variable

    - #### variableAssigned

          public void variableAssigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment,
                                       long iteration,
                                       TeachingAssignment ta)

      Description copied from class: `Variable`
      A value was assigned to this variable
      Overrides:
        `variableAssigned` in class `Variable<TeachingRequest.Variable,TeachingAssignment>`
      Parameters:
        `assignment` - current assignment
        `iteration` - current iteration
        `ta` - assigned value

    - #### variableUnassigned

          public void variableUnassigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment,
                                         long iteration,
                                         TeachingAssignment ta)

      Description copied from class: `Variable`
      A value was unassigned from this variable
      Overrides:
        `variableUnassigned` in class `Variable<TeachingRequest.Variable,TeachingAssignment>`
      Parameters:
        `assignment` - current assignment
        `iteration` - current iteration
        `ta` - unassigned value

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Variable<TeachingRequest.Variable,TeachingAssignment>`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Variable<TeachingRequest.Variable,TeachingAssignment>`

    - #### getName

          public String getName()

      Description copied from class: `Variable`
      Variable's name -- for printing purposes
      Overrides:
        `getName` in class `Variable<TeachingRequest.Variable,TeachingAssignment>`
      Returns:
        variable name