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

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Model<Operation,Location>
      extended by net.sf.cpsolver.ifs.example.jobshop.JobShopModel

public class JobShopModel
extends Model<Operation,Location>

Job Shop model.

It contains the number of available time slots and all machines and jobs.

It can also load the model from a file and save the solution.

Input file format:


Output file firmat:

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

Field Summary
 
Fields inherited from class net.sf.cpsolver.ifs.model.Model
iAssignedVariables, iPerturbVariables, iUnassignedVariables, sDoubleFormat, sPercentageFormat, sTimeFormat
 
Constructor Summary
JobShopModel(int nrMachines, int nrJobs)
          Constructor �
 
Method Summary
 int countJobs()
          Count number of jobs in the model
 int countMachines()
          Count number of machines in the model
 int getFinishingTime()
          Get finishing time of the current (partial) solution
 Map<String,String> getInfo()
          Get information table
 Job getJob(int jobNumber)
          Get job of the given number
 Machine getMachine(int machineNumber)
          Get machine of the given numbner
 int getTotalNumberOfSlots()
          Get total number of slots
static JobShopModel loadModel(String file)
          Loads the model from the given file
 void save(String file)
          Save the solution into the given file
 
Methods inherited from class net.sf.cpsolver.ifs.model.Model
addConstraint, addCriterion, addGlobalConstraint, addModelListener, addVariable, afterAssigned, afterUnassigned, assignedVariables, beforeAssigned, beforeUnassigned, bestUnassignedVariables, clearBest, conflictConstraints, conflictValues, constraints, countConstraints, countGlobalConstraints, countVariables, getBestPerturbations, getBestUnassignedVariables, getCriteria, getCriterion, getExtendedInfo, getInfo, getInfoProviders, getModelListeners, getPerc, getPercRev, getTotalValue, getTotalValue, globalConstraints, inConflict, init, invalidateVariablesWithInitialValueCache, modelListenerOfType, nrAssignedVariables, nrUnassignedVariables, perturbVariables, perturbVariables, removeConstraint, removeCriterion, removeCriterion, removeGlobalConstraint, removeModelListener, removeVariable, restoreBest, restoreBest, saveBest, toString, unassignedHardConstraints, unassignedVariables, variables, variablesWithInitialValue, weaken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JobShopModel

public JobShopModel(int nrMachines,
                    int nrJobs)
Constructor �

Parameters:
nrMachines - number of machines
nrJobs - number of jobs
Method Detail

getTotalNumberOfSlots

public int getTotalNumberOfSlots()
Get total number of slots


getMachine

public Machine getMachine(int machineNumber)
Get machine of the given numbner


countMachines

public int countMachines()
Count number of machines in the model


getJob

public Job getJob(int jobNumber)
Get job of the given number


countJobs

public int countJobs()
Count number of jobs in the model


loadModel

public static JobShopModel loadModel(String file)
                              throws IOException
Loads the model from the given file

Throws:
IOException

getFinishingTime

public int getFinishingTime()
Get finishing time of the current (partial) solution


getInfo

public Map<String,String> getInfo()
Get information table

Overrides:
getInfo in class Model<Operation,Location>

save

public void save(String file)
          throws IOException
Save the solution into the given file

Throws:
IOException


Copyright © 2014 UniTime LLC. All Rights Reserved.