org.cpsolver.coursett.criteria.additional

## Class InstructorFairness

- java.lang.Object
- - org.cpsolver.ifs.criteria.AbstractCriterion<Lecture,Placement>
  - - org.cpsolver.coursett.criteria.TimetablingCriterion
    - - org.cpsolver.coursett.criteria.additional.InstructorFairness

- All Implemented Interfaces:
    CanHoldContext, HasAssignmentContext<Lecture,Placement,AbstractCriterion.ValueContext>, Criterion<Lecture,Placement>, ExtendedInfoProvider<Lecture,Placement>, InfoProvider<Lecture,Placement>, ModelListener<Lecture,Placement>

      public class InstructorFairness
      extends TimetablingCriterion

  This class represent fairness criterion for instructors. Criterion iteratively evaluate instructors fairness, based on absolute deviation of the individual satisfaction of instructors time (or time and room) requirements.
  Version:
    CourseTT 1.3 (University Course Timetabling)
    Copyright (C) 2015 Rostislav Burget
    BurgetRostislav@gmail.com
    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/ .
  Author:
    Rostislav Burget
    implemented criterion: Instructor Fairness

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `InstructorFairness.InstructorFairnessContext` Context for InstructorFairness

    - ### Nested classes/interfaces inherited from class org.cpsolver.ifs.criteria.AbstractCriterion

      `AbstractCriterion.ValueContext, AbstractCriterion.ValueUpdateType`

  - ### Field Summary

    - ### Fields inherited from class org.cpsolver.ifs.criteria.AbstractCriterion

      `iBest, iDebug, iWeight, sDoubleFormat, sPercentFormat`

    - ### Fields inherited from interface org.cpsolver.ifs.assignment.context.CanHoldContext

      `sMaxSize`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InstructorFairness()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `bestSaved(Assignment<Lecture,Placement> assignment)` Notification that the current solution has been saved to the best.
    `AbstractCriterion.ValueContext` | `createAssignmentContext(Assignment<Lecture,Placement> assignment)` Create a new assignment context for the given assignment.
    `void` | `getExtendedInfo(Assignment<Lecture,Placement> assignment, Map<String,String> info)` Extended information about current solution.
    `void` | `getInfo(Assignment<Lecture,Placement> assignment, Map<String,String> info)` Adds some information into the table with information about the solution
    `void` | `getInfo(Assignment<Lecture,Placement> assignment, Map<String,String> info, Collection<Lecture> variables)` Adds some information into the table with information about the solution, only consider variables from the given set
    `String` | `getPlacementSelectionWeightName()`
    `double` | `getValue(Assignment<Lecture,Placement> assignment)` Current value of the criterion (optimization objective)
    `double` | `getValue(Assignment<Lecture,Placement> assignment, Collection<Lecture> variables)` Value of a part of the problem (given by the collection of variables)
    `double` | `getValue(Assignment<Lecture,Placement> assignment, Placement value, Set<Placement> conflicts)` Value of a proposed assignment (including hard conflicts)
    `double` | `getWeightDefault(DataProperties config)` Defines default weight (when `AbstractCriterion.getWeightName()` parameter is not present in the criterion).

    - ### Methods inherited from class org.cpsolver.coursett.criteria.TimetablingCriterion

      `configure, getPlacementSelectionAdjustmentsName, getPlacementSelectionWeight, getPlacementSelectionWeightDefault`

    - ### Methods inherited from class org.cpsolver.ifs.criteria.AbstractCriterion

      `afterAssigned, afterUnassigned, beforeAssigned, beforeUnassigned, bestRestored, clearCache, computeBounds, constraintAdded, constraintRemoved, getAbbreviation, getAssignmentContextReference, getBest, getBounds, getBounds, getBounds, getBounds, getContext, getContext, getModel, getName, getPerc, getPercentage, getPercRev, getValue, getValue, getValueUpdateType, getWeight, getWeightedBest, getWeightedValue, getWeightedValue, getWeightedValue, getWeightedValue, getWeightedValue, getWeightedValue, getWeightName, inc, inc, init, setAssignmentContextReference, setModel, setValueUpdateType, toString, variableAdded, variableRemoved`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InstructorFairness

          public InstructorFairness()

  - ### Method Detail

    - #### getWeightDefault

          public double getWeightDefault(DataProperties config)

      Description copied from class: `AbstractCriterion`
      Defines default weight (when `AbstractCriterion.getWeightName()` parameter is not present in the criterion).
      Overrides:
        `getWeightDefault` in class `AbstractCriterion<Lecture,Placement>`
      Parameters:
        `config` - solver configuration
      Returns:
        default criterion weight value

    - #### getPlacementSelectionWeightName

          public String getPlacementSelectionWeightName()

      Overrides:
        `getPlacementSelectionWeightName` in class `TimetablingCriterion`

    - #### bestSaved

          public void bestSaved(Assignment<Lecture,Placement> assignment)

      Description copied from interface: `Criterion`
      Notification that the current solution has been saved to the best.
      Specified by:
        `bestSaved` in interface `Criterion<Lecture,Placement>`
      Overrides:
        `bestSaved` in class `AbstractCriterion<Lecture,Placement>`
      Parameters:
        `assignment` - current assignment

    - #### getValue

          public double getValue(Assignment<Lecture,Placement> assignment,
                                 Placement value,
                                 Set<Placement> conflicts)

      Description copied from interface: `Criterion`
      Value of a proposed assignment (including hard conflicts)
      Parameters:
        `assignment` - current assignment
        `value` - given value
        `conflicts` - values conflicting with the given value
      Returns:
        change in this criterion value when assigned

    - #### getValue

          public double getValue(Assignment<Lecture,Placement> assignment)

      Description copied from interface: `Criterion`
      Current value of the criterion (optimization objective)
      Specified by:
        `getValue` in interface `Criterion<Lecture,Placement>`
      Overrides:
        `getValue` in class `AbstractCriterion<Lecture,Placement>`
      Parameters:
        `assignment` - current assignment
      Returns:
        value of this criterion

    - #### getValue

          public double getValue(Assignment<Lecture,Placement> assignment,
                                 Collection<Lecture> variables)

      Description copied from interface: `Criterion`
      Value of a part of the problem (given by the collection of variables)
      Specified by:
        `getValue` in interface `Criterion<Lecture,Placement>`
      Overrides:
        `getValue` in class `AbstractCriterion<Lecture,Placement>`
      Parameters:
        `assignment` - current assignment
        `variables` - list of problem variables
      Returns:
        value of the given variables

    - #### getInfo

          public void getInfo(Assignment<Lecture,Placement> assignment,
                              Map<String,String> info)

      Description copied from interface: `InfoProvider`
      Adds some information into the table with information about the solution
      Specified by:
        `getInfo` in interface `InfoProvider<Lecture,Placement>`
      Overrides:
        `getInfo` in class `AbstractCriterion<Lecture,Placement>`
      Parameters:
        `assignment` - current assignment
        `info` - info table

    - #### getInfo

          public void getInfo(Assignment<Lecture,Placement> assignment,
                              Map<String,String> info,
                              Collection<Lecture> variables)

      Description copied from interface: `InfoProvider`
      Adds some information into the table with information about the solution, only consider variables from the given set
      Specified by:
        `getInfo` in interface `InfoProvider<Lecture,Placement>`
      Overrides:
        `getInfo` in class `AbstractCriterion<Lecture,Placement>`
      Parameters:
        `assignment` - current assignment
        `info` - info table
        `variables` - sub-problem

    - #### getExtendedInfo

          public void getExtendedInfo(Assignment<Lecture,Placement> assignment,
                                      Map<String,String> info)

      Description copied from interface: `ExtendedInfoProvider`
      Extended information about current solution. Similar to `InfoProvider.getInfo(Assignment, Map)`, but some more information (that is more expensive to compute) might be added.
      Specified by:
        `getExtendedInfo` in interface `ExtendedInfoProvider<Lecture,Placement>`
      Overrides:
        `getExtendedInfo` in class `AbstractCriterion<Lecture,Placement>`
      Parameters:
        `assignment` - current assignment
        `info` - extended info

    - #### createAssignmentContext

          public AbstractCriterion.ValueContext createAssignmentContext(Assignment<Lecture,Placement> assignment)

      Description copied from interface: `HasAssignmentContext`
      Create a new assignment context for the given assignment. If there are already some variables assigned in the value, the method should make sure that the context is appropriately initialized.
      Specified by:
        `createAssignmentContext` in interface `HasAssignmentContext<Lecture,Placement,AbstractCriterion.ValueContext>`
      Overrides:
        `createAssignmentContext` in class `AbstractCriterion<Lecture,Placement>`
      Parameters:
        `assignment` - an assignment for which there needs to be an assignment context
      Returns:
        a new instance of the assignment context, filled according to the given assignment