net.sf.cpsolver.ifs.example.jobshop
Class Job

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Constraint<Operation,Location>
      extended by net.sf.cpsolver.ifs.example.jobshop.Job
All Implemented Interfaces:
Comparable<Constraint<Operation,Location>>

public class Job
extends Constraint<Operation,Location>

Job constraint.

Each job contians a given set of operations (variables). A job constraint is satisfied, if all operations of the job do not overlap in time and are processed in the given order.

Version:
IFS 1.2 (Iterative Forward Search)
Copyright (C) 2006 - 2010 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/.

Field Summary
 
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint
iAssignedVariables, iConstraintListeners, iId
 
Constructor Summary
Job(int jobNumber)
          Constructor
 
Method Summary
 void computeConflicts(Location location, Set<Location> conflicts)
          Adds conflicting operations into the set of conflicts.
 int countOperations()
          Count job operations for the job (i.e., the number of variables in this constraint)
 int getDueTime()
          Get due time
 int getJobNumner()
          Get job number
 String getName()
          Name of the job (e.g.
 Operation getOperation(int opNumber)
          Get operation of the given index (0..countOperations()-1)
 boolean inConflict(Location location)
          True if there is an operation from the same job which violates with the given assignment.
 boolean isConsistent(Location location1, Location location2)
          True if the two assignments (placement of opeartions of the same job in time) violates each other.
 void setDueTime(int dueTime)
          Set due time
 String toString()
          String representation -- for debuging and printing purposes
 
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint
addConstraintListener, addVariable, assigned, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, unassigned, variables
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Job

public Job(int jobNumber)
Constructor

Parameters:
jobNumber - job number
Method Detail

setDueTime

public void setDueTime(int dueTime)
Set due time


getDueTime

public int getDueTime()
Get due time


getJobNumner

public int getJobNumner()
Get job number


countOperations

public int countOperations()
Count job operations for the job (i.e., the number of variables in this constraint)


getOperation

public Operation getOperation(int opNumber)
Get operation of the given index (0..countOperations()-1)


computeConflicts

public void computeConflicts(Location location,
                             Set<Location> conflicts)
Adds conflicting operations into the set of conflicts.

Specified by:
computeConflicts in class Constraint<Operation,Location>
Parameters:
location - value to be assigned to its varaible
conflicts - resultant set of conflicting values

inConflict

public boolean inConflict(Location location)
True if there is an operation from the same job which violates with the given assignment.

Overrides:
inConflict in class Constraint<Operation,Location>

isConsistent

public boolean isConsistent(Location location1,
                            Location location2)
True if the two assignments (placement of opeartions of the same job in time) violates each other.

Overrides:
isConsistent in class Constraint<Operation,Location>

toString

public String toString()
String representation -- for debuging and printing purposes

Overrides:
toString in class Object

getName

public String getName()
Name of the job (e.g. J10 where 10 is the job number)

Overrides:
getName in class Constraint<Operation,Location>