FRAMES NO FRAMES

Class IloSchedulerSolution

Definition file: ilsched/ilosolution.h
Include file: <ilsched/iloscheduler.h>

The class IloSchedulerSolution has two distinct purposes. One use is for the storage of solution data, and the other use is as the central data structure for local search. These two purposes are quite different and so it is useful to clearly distinguish between them.

IloSchedulerSolution for Data Storage

As a general object in which to store information about the state of the solver at the level of scheduling, an IloSchedulerSolution object can be used to store and inspect activities, resources and resource constraints. This information can be modified within the IloSchedulerSolution object, however, the modifications only affect the data stored in the solution object. If you want the modifications reflected either in the model or in a solver, it is necessary to directly modify the model or the objects extracted in a solver. For example, you can store an instance of an IloActivity in a solution object as follows:

 IloSchedulerSolution sol(env);
 IloActivity act(env, 10);
 sol.add(act);

If we assume that act is part of a model that has been extracted by an IlcScheduler object, schedule, and solved by the associated solver, we can then store the activity in the solution with the command:

 sol.store(scheduler);

This command causes the solver data regarding act (and any other extractables added to the solution) to be stored in the solution. In the example of an IloActivity, the bounds on the start time, end time, processing time, and duration variables are stored together with any external variable that you may have associated with the activity.

Note that the data that is stored is retrieved from the current state of the solver.

The data in the solution can then be modified via the IloSchedulerSolution API. For example, to set the value of the start time in the solution, you can write:

 sol.setStartMin(act, 10);
 sol.setStartMax(act, 10);

Note that these commands only change the data stored in sol. In particular the original model is unchanged and the value of the start time of the IlcActivity that the solver has extracted from act is unchanged. To change the model, the extractable itself must be changed. For example,

 act.setLb(sol.getStartMin(act));
 act.setUb(sol.getStartMax(act));

Similarly, you can write a search goal which takes an IloSchedulerSolution object as an argument and then, once inside the search, adds constraints to the solver based on the information stored in the IloSchedulerSolution.

IloSchedulerSolution for Local Search

In local search in IBM® ILOG® Scheduler, IloSchedulerSolution plays the same role as the IloSolution object does in local search in IBM ILOG Solver (see the IBM ILOG Solver Reference Manual). That is, an IloSchedulerSolution is used to represent a neighbor that is to be explored. Typically, such a neighbor is specified by an IloSchedulerSolution which contains only those objects which change in moving from the current solution to the neighbor. The values of those objects in the solution reflect their values in the neighbor that is to be explored. For example, assume you have a solution where four resource constraints on the same resource are ordered as follows: A before B before C before D.

Further assume that one of the neighbors you want to explore is the one where the order of B and C is reversed. The following code will create an IloSchedulerSolution object that represents such a neighbor:

 IloSchedulerSolution delta(env);
 delta.add(A, IloRestoreRCNext);
 delta.add(B, IloRestoreRCNext);
 delta.add(C, IloRestoreRCNext);
 delta.setNext(A, C);
 delta.setNext(C, B);
 delta.setNext(B, D);

Notice that the IloSchedulerSolution::add method requires a second argument in this case. This argument specifies what part of the information stored in the solution about the extractable is to be restored by the solver. This information is only relevant in four cases:

  1. During local search.
  2. If you use the IloRestoreSolution goal.
  3. If you use the IloSolution::getConstraint method.
  4. If you use the IloSolution::restore method.

In each of these cases, the actual information that is restored (or, in the case of IloSolution::getConstraint, added as a constraint) depends on the fields that have been defined to be restored. By default, for IloActivity and IloResourceConstraint all the stored information is restored. Note that for IloResource (and its subclasses) nothing can be restored in this way. This is because, from a local search perspective, the resource does not contain any decision variables.

For more information about local search see the IBM ILOG Solver Reference Manual and the IBM ILOG Solver User Manual.

Storing Solutions

There are two ways to store solutions. Users can choose the method they prefer and mix methods if desired.

In the first method, all the objects that are to be stored are added to the solution once using IloSchedulerSolution::add. Then, when the solver is in the search state that is to be stored, a single call to the function IloSchedulerSolution::store(const IlcScheduler scheduler) will store all the added objects that have been extracted by the solver associated with scheduler.

In the second method, there is no need to add the objects to the solution. Instead, when the solver is in the search state that is to be stored, a call to IlcSchedulerSolution::store can be made for each object that is to be stored. For example, IloSchedulerSolution::store(const IloActivity activity, IlcScheduler scheduler) will add activity to the solution and then immediately store it.

Sharing Solutions

IloSchedulerSolution inherits from class IloSolution (see the IBM ILOG Concert Technology Reference Manual). This means that all of the actual implementation of the data structure for storing objects is performed by the instance of IloSolution. In addition, an instance of IloSchedulerSolution can be casted to an instance of IloSolution back and forth. This allow to share a single solution instance among different solvers. For example, IBM® ILOG® Dispatcher (see the IBM ILOG Dispatcher Reference Manual) contains an IloRoutingSolution that also inherits from class IloSolution. In a problem that uses both Scheduler and Dispatcher, a single IloSolution instance can be shared between the two solvers by casting it to the appropriate class.

Storing Objects

When an object is stored, with either method described earlier, the values of its variables—assuming they are instantiated—are stored in the scheduler solution. If a variable is not bound, the minimal and the maximal value of its domain are stored in most cases.

Consequently, the minimal capacity level of a resource at time t is the sum of the minimal capacities of all resource constraints that surely contribute to the resource and that are associated with activities that surely cover time t.

If the resource is closed, the maximal capacity level of the resource at time t is the sum of the maximal capacities of all resource constraints that possibly contribute to the resource and that are associated with activities that possibly cover time t. If the resource is not closed, the maximal capacity level of the resource at time t is equal to IloInfinity.

Accessing Stored Objects

An instance of the class IloSchedulerSolution represents a mapping between stored Scheduler objects and their (possible) values. It is important to note that this mapping is not reversible. This means that the values of the stored objects are preserved when backtracking. The values of the stored objects can be accessed at any time by calling appropriate member functions of the class IloSchedulerSolution. There are also iterators that allow access to all the objects stored in a scheduler solution.

Modifying Values of Stored Objects

It is possible to modify the values of the stored objects by calling appropriate member functions of the class IloSchedulerSolution.

Restoring a solution

Relations of type next and previous as well as setup and teardown are restored only on unary resources that have a precedence graph (either light or classical).

Successors and predecessors are always restored even if the resource has no precedence graph.

For alternative resource constraints, edges of type next, previous, successor and predecessor are restored only if both resource constraints are or can be on the same resource. When a next, previous, successor or predecessor relation between two resource constraints is restored, it means that whenever both resource constraints are allocated the same resource, the relation holds.

Deleting Solutions

The IloSchedulerSolution class provides an end function that frees all the memory used to save the data in a solution. Explicitly calling this function is unnecessary as the memory will also be reclaimed when the IloEnv is destroyed. However, if the user is creating and manipulating a large number of solutions, it may be desirable to reclaim memory from IlcSchedulerSolution instances that are no longer needed. The end function has been provided for just such a situation.

For more information, see IloNumToAnySetStepFunction in the IBM ILOG Concert Technology Reference Manual. Also see Global Constraints.

See Also:

Constructor Summary
public IloSchedulerSolution(const IloEnv, const char * name=0)
public IloSchedulerSolution(const IloSolution)
public IloSchedulerSolution(const IloModel, const char * name=0)
Method Summary
public voidadd(const IloResource x) const
public voidadd(const IloModel x) const
public voidadd(const IloResourceConstraint x, IloInt restoreFields=IloRestoreAll) const
public voidadd(const IloActivity x, IloInt restoreFields=IloRestoreAll) const
public IloBoolareLevelsStoredWithBounds(const IloResource res) const
public voidcopy(IloSchedulerSolution solution) const
public IloNumgetCapacityMax(const IloResourceConstraint rct) const
public IloNumgetCapacityMin(const IloResourceConstraint rct) const
public IloNumToNumSegmentFunctiongetContinuousLevelMax(const IloResource res) const
public IloNumToNumSegmentFunctiongetContinuousLevelMin(const IloResource res) const
public IloNumToNumStepFunctiongetDiscreteLevelMax(const IloResource resource) const
public IloNumToNumStepFunctiongetDiscreteLevelMin(const IloResource resource) const
public IloNumgetDurationMax(const IloActivity activity) const
public IloNumgetDurationMin(const IloActivity activity) const
public IloNumgetEndMax(const IloActivity activity) const
public IloNumgetEndMin(const IloActivity activity) const
public IloEnvgetEnv() const
public IloNumgetExternalVariableMax(const IloActivity activity) const
public IloNumgetExternalVariableMin(const IloActivity activity) const
public IloNumgetLevelMax(const IloResource resource, IloNum time) const
public IloNumgetLevelMin(const IloResource resource, IloNum time) const
public IloResourceConstraintgetNextRC(const IloResourceConstraint rct) const
public IloResourceConstraintgetPrevRC(const IloResourceConstraint rct) const
public IloNumgetProcessingTimeMax(const IloActivity activity) const
public IloNumgetProcessingTimeMin(const IloActivity activity) const
public IloIntgetRestorable(IloResourceConstraint rc) const
public IloIntgetRestorable(IloActivity activity) const
public IloResourcegetSelected(const IloResourceConstraint rct) const
public IloResourceConstraintgetSetupRC(const IloResource resource) const
public IloNumgetStartMax(const IloActivity activity) const
public IloNumgetStartMin(const IloActivity activity) const
public IloResourceConstraintgetTeardownRC(const IloResource resource) const
public IloBoolhasAsNext(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const
public IloBoolhasCapacityInformation(const IloResource resource) const
public IloBoolhasPredecessors(const IloResourceConstraint rct)
public IloBoolhasSuccessors(const IloResourceConstraint rct)
public IloBoolisResourceSelected(const IloResourceConstraint rct) const
public IloBoolisSetup(const IloResourceConstraint rct) const
public IloBoolisSucceededBy(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const
public IloBoolisTeardown(const IloResourceConstraint rct) const
public IloSchedulerSolutionmakeClone(IloEnv e) const
public voidremove(IloModel m) const
public voidsetCapacityMax(const IloResourceConstraint ct, IloNum max) const
public voidsetCapacityMin(const IloResourceConstraint ct, IloNum min) const
public voidsetDurationMax(const IloActivity activity, IloNum max) const
public voidsetDurationMin(const IloActivity activity, IloNum min) const
public voidsetEndMax(const IloActivity activity, IloNum max) const
public voidsetEndMin(const IloActivity activity, IloNum min) const
public voidsetExternalVariableMax(const IloActivity activity, IloNum max) const
public voidsetExternalVariableMin(const IloActivity activity, IloNum min) const
public voidsetLevelMax(const IloResource resource, IloNum start, IloNum end, IloNum max) const
public voidsetLevelMin(const IloResource resource, IloNum start, IloNum end, IloNum min) const
public voidsetLevelsStoredWithBounds(const IloResource res, IloBool withBounds=IloTrue) const
public voidsetNext(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const
public voidsetNonRestorable(IloResourceConstraint rc) const
public voidsetNonRestorable(IloActivity activity) const
public voidsetProcessingTimeMax(const IloActivity activity, IloNum max) const
public voidsetProcessingTimeMin(const IloActivity activity, IloNum min) const
public voidsetRestorable(IloResourceConstraint rc, IloInt storeFields) const
public voidsetRestorable(IloActivity activity, IloInt storeFields) const
public voidsetSelected(IloResourceConstraint rct, const IloResource resource) const
public voidsetSetup(const IloResourceConstraint rct) const
public voidsetStartMax(const IloActivity activity, IloNum max) const
public voidsetStartMin(const IloActivity activity, IloNum min) const
public voidsetSuccessor(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const
public voidsetTeardown(const IloResourceConstraint rct) const
public voidstore(const IloResourceConstraint ct, const IlcScheduler scheduler) const
public voidstore(const IloResource resource, const IlcScheduler scheduler) const
public voidstore(const IloActivity activity, const IlcScheduler scheduler) const
public voidstore(const IlcScheduler scheduler) const
public voidunsetNext(const IloResourceConstraint rct) const
public voidunsetNext(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const
public voidunsetPrecedences()
public voidunsetPrecedences(const IloResource resource)
public voidunsetPredecessors(const IloResourceConstraint rct) const
public voidunsetPrev(const IloResourceConstraint rct) const
public voidunsetSelected(const IloResourceConstraint rct) const
public voidunsetSequence(const IloResource resource)
public voidunsetSequences()
public voidunsetSetup(const IloResourceConstraint rct) const
public voidunsetSuccessor(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const
public voidunsetSuccessors(const IloResourceConstraint rct) const
public voidunsetTeardown(const IloResourceConstraint rct) const
Inner Enumeration
IloSchedulerSolution::IloResourceConstraintIteratorFilter
Inner Class
IloSchedulerSolution::ActivityIterator
IloSchedulerSolution::ResourceConstraintIterator
IloSchedulerSolution::ResourceIterator
Constructor Detail

IloSchedulerSolution

public IloSchedulerSolution(const IloEnv, const char * name=0)

This constructor creates a new instance of the class IloSchedulerSolution. This instance does not contain stored objects. Objects can be stored in this instance by calling the member function IloSchedulerSolution::store.


IloSchedulerSolution

public IloSchedulerSolution(const IloSolution)

This constructor creates an instance of IloSchedulerSolution that is an interface to the passed IloSolution solution. Rather than creating an internal IloSolution, an argument is used.

This constructor can be used to share an IloSolution instance among a number of solvers, each with a different interface to a solution object.


IloSchedulerSolution

public IloSchedulerSolution(const IloModel, const char * name=0)

This constructor creates a scheduler solution from the environment associated with model. It calls add(IloModel) and adds all the scheduler extractables (that is, IloActivity, IloResourceConstraint, IloResource and its subclasses) that have been explicity added to the model to the solution. The optional argument name, if provided, becomes the name of the underlying IloSolution associated with the newly created IloSchedulerSolution.


Method Detail

add

public void add(const IloResource x) const

This member function adds the passed IloResource to the list of objects in the solution. The next time IloSchedulerSolution::store(const IlcScheduler) is called, the resource will be stored.


add

public void add(const IloModel x) const

This member function adds model x to the invoking scheduler solution. That is, all activities, resource constraints, and resources that have been explicitly added to model are added to the invoking routing solution.


add

public void add(const IloResourceConstraint x, IloInt restoreFields=IloRestoreAll) const

This member function adds x to the list of objects in the solution. The next time IloSchedulerSolution::store(const IlcScheduler) is called, the resource constraint will be stored. The storeFields argument defines the fields that will be restored when applying goal IloRestoreSolution or when calling method IloSolution::restore. Valid values of restoreFields are IloRestoreNothing, IloRestoreAll, and any bitwise-OR combination of IloRestoreRCNext, IloRestoreRCPrev, IloRestoreRCDirectSuccessor, IloRestoreRCDirectPredecessors, IloRestoreRCSetup, IloRestoreRCTeardown, IloRestoreRCCapacity, and IloRestoreRCSelected.

Note
Warning If IloResourceConstraint does not have a resource selected, the precedence relations of type next, previous, direct successor, direct predecessor, setup and teardown will not be stored.

add

public void add(const IloActivity x, IloInt restoreFields=IloRestoreAll) const

This member function adds x to the list of objects in the solution. The next time IloScheduler::store(const IlcScheduler) is called, the activity will be stored. The restoreFields argument defines the fields that will be restored in local search, the IloRestoreSolution goal, and via the IloSolution::getConstraint methods. Valid values of storeFields are IloRestoreNothing, IloRestoreAll, and any bitwise-OR combination of IloRestoreActivityStart, IloRestoreActivityEnd, IloRestoreActivityDuration, IloRestoreActivityProcessingTime, IloRestoreActivityExternal.


areLevelsStoredWithBounds

public IloBool areLevelsStoredWithBounds(const IloResource res) const

This member function returns IloTrue if the current storage mode of res is “with bounds.” See the section "Storing Objects" at the start of this class for more information.

This member function should be used only if res is stored in the scheduler solution and contains information about capacity levels.


copy

public void copy(IloSchedulerSolution solution) const

This member function copies solution to the invoking scheduler solution.


getCapacityMax

public IloNum getCapacityMax(const IloResourceConstraint rct) const

This member function returns the maximal capacity of the given resource constraint in the invoking scheduler solution.

This member function should be used only if rct is stored in the scheduler solution.


getCapacityMin

public IloNum getCapacityMin(const IloResourceConstraint rct) const

This member function returns the minimal capacity of the given resource constraint in the invoking scheduler solution.

This member function should be used only if rct is stored in the scheduler solution.


getContinuousLevelMax

public IloNumToNumSegmentFunction getContinuousLevelMax(const IloResource res) const

This member function returns a piecewise linear function describing the stored maximal level of res in the invoking scheduler solution. The returned piecewise linear function is a physical representation of the maximal level of res in the solution. Therefore, it is possible to modify the stored maximal level by modifying the piecewise linear function; and modifying the stored maximal level of res modifies the returned piecewise linear function.

This member function should be used only if res is stored in the scheduler solution and contains information about capacity levels.


getContinuousLevelMin

public IloNumToNumSegmentFunction getContinuousLevelMin(const IloResource res) const

This member function returns a piecewise linear function describing the stored minimal level of res in the invoking scheduler solution. The returned piecewise linear function is a physical representation of the minimal level of res in the solution. Therefore, it is possible to modify the stored minimal level by modifying the piecewise linear function; and modifying the stored minimal level of res modifies the returned piecewise linear function.

This member function should be used only if res is stored in the scheduler solution and contains information about capacity levels.


getDiscreteLevelMax

public IloNumToNumStepFunction getDiscreteLevelMax(const IloResource resource) const

This member function returns a step function describing the stored maximal level of resource in the invoking scheduler solution. The returned step function is a physical representation of the maximal level of resource in the solution. Therefore, it is possible to modify the stored maximal level by modifying the step function; and modifying the stored maximal level of resource modifies the returned step function.

This member function should be used only if resource is stored in the scheduler solution and contains information about capacity levels. This member function must not be used if resource is a continuous reservoir.


getDiscreteLevelMin

public IloNumToNumStepFunction getDiscreteLevelMin(const IloResource resource) const

This member function returns a step function describing the stored minimal level of resource in the invoking scheduler solution. The returned step function is a physical representation of the minimal level of resource in the solution. Therefore, it is possible to modify the stored minimal level by modifying the step function; and modifying the stored minimal level of resource modifies the returned step function.

This member function should be used only if resource is stored in the scheduler solution and contains information about capacity levels. This member function must not be used if resource is a continuous reservoir.


getDurationMax

public IloNum getDurationMax(const IloActivity activity) const

This member function returns the maximal duration of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getDurationMin

public IloNum getDurationMin(const IloActivity activity) const

This member function returns the minimal duration of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getEndMax

public IloNum getEndMax(const IloActivity activity) const

This member function returns the maximal end time of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getEndMin

public IloNum getEndMin(const IloActivity activity) const

This member function returns the minimal end time of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getEnv

public IloEnv getEnv() const

This member function returns the environment for which the scheduler solution was created.


getExternalVariableMax

public IloNum getExternalVariableMax(const IloActivity activity) const

This member function returns the maximal value for the external variable of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getExternalVariableMin

public IloNum getExternalVariableMin(const IloActivity activity) const

This member function returns the minimal value for the external variable of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getLevelMax

public IloNum getLevelMax(const IloResource resource, IloNum time) const

This member function returns the maximal level of the given resource in the invoking scheduler solution at the given time.

This member function should be used only if resource is stored in the scheduler solution and contains information about capacity levels.


getLevelMin

public IloNum getLevelMin(const IloResource resource, IloNum time) const

This member function returns the minimal level of the given resource in the invoking scheduler solution at the given time.

This member function should be used only if resource is stored in the scheduler solution and contains information about capacity levels.


getNextRC

public IloResourceConstraint getNextRC(const IloResourceConstraint rct) const

This member function returns the next resource constraint of the given resource constraint in the invoking scheduler solution, if such a next constraint exists. In case there are several such constraints, this method returns an empty handle: see IloSchedulerSolution::ResourceConstraintIterator to iterate on all the next resource constraints.

This member function should be used only if rct is stored in the invoking scheduler solution.


getPrevRC

public IloResourceConstraint getPrevRC(const IloResourceConstraint rct) const

This member function returns the previous resource constraint of the given resource constraint in the invoking scheduler solution, if such a previous constraint exists. In case there are several such constraints, the method returns an empty handle : see IloSchedulerSolution::ResourceConstraintIterator to iterate on all previous resource constraints.

This member function should be used only if rct is stored in the invoking scheduler solution.


getProcessingTimeMax

public IloNum getProcessingTimeMax(const IloActivity activity) const

This member function returns the maximal processing time of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getProcessingTimeMin

public IloNum getProcessingTimeMin(const IloActivity activity) const

This member function returns the minimal processing time of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getRestorable

public IloInt getRestorable(IloResourceConstraint rc) const

This method returns the value representing the fields of rc that will be restored.


getRestorable

public IloInt getRestorable(IloActivity activity) const

This method returns the value representing the fields of activity that will be restored.


getSelected

public IloResource getSelected(const IloResourceConstraint rct) const

This member function returns the selected resource of the given resource constraint in the invoking scheduler solution if this selected resource exists.

This member function should be used only if rct is stored in the scheduler solution.


getSetupRC

public IloResourceConstraint getSetupRC(const IloResource resource) const

This member function returns the setup resource constraint of the given resource in the invoking scheduler solution, if such a setup resource constraint exists. In case there are several such constraints, this method returns an empty handle.

This member function should be used only if resource is stored in the invoking scheduler solution.


getStartMax

public IloNum getStartMax(const IloActivity activity) const

This member function returns the maximal start time of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getStartMin

public IloNum getStartMin(const IloActivity activity) const

This member function returns the minimal start time of the given activity in the invoking scheduler solution.

This member function should be used only if activity is stored in the scheduler solution.


getTeardownRC

public IloResourceConstraint getTeardownRC(const IloResource resource) const

This member function returns the teardown resource constraint of the given resource in the invoking scheduler solution, if such a teardown resource constraint exists. In case there are several such constraints, this method returns an empty handle.

This member function should be used only if resource is stored in the invoking scheduler solution.


hasAsNext

public IloBool hasAsNext(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const

This member function returns IloTrue if the resource constraint srct2 is a next resource constraint of the resource constraint rct1 in the invoking scheduler solution. Otherwise, it returns IloFalse.


hasCapacityInformation

public IloBool hasCapacityInformation(const IloResource resource) const

This member function returns IloTrue if information about capacity levels has been stored for the resource in the invoking scheduler solution. Otherwise, it returns IloFalse.

Capacity information is stored for resources only if sufficient information is available from the solver. In the case of IlcScheduler, the timetable constraint must exist on the resources in order for the capacity information to be stored in the solution. See Resource Enforcement as Global Constraint Declaration.


hasPredecessors

public IloBool hasPredecessors(const IloResourceConstraint rct)

This member function returns IloTrue if the resource constraint rct has at least one predecessor in the invoking scheduler solution. Otherwise it returns IloFalse.

This member function should be used only if rct is stored in the invoking scheduler solution.


hasSuccessors

public IloBool hasSuccessors(const IloResourceConstraint rct)

This member function returns IloTrue if the resource constraint rct has at least one successor in the invoking scheduler solution. Otherwise it returns IloFalse.

This member function should be used only if rct is stored in the invoking scheduler solution.


isResourceSelected

public IloBool isResourceSelected(const IloResourceConstraint rct) const

This member function returns IloTrue if the given resource constraint has a selected resource in the invoking scheduler solution. Otherwise, it returns IloFalse.

This member function should be used only if rct is stored in the scheduler solution.


isSetup

public IloBool isSetup(const IloResourceConstraint rct) const

This member function returns IloTrue if rct is the setup (that is, the first) resource constraint of its resource in the invoking scheduler solution. Otherwise, it returns IloFalse.

This member function should be used only if rct is stored in the invoking scheduler solution.


isSucceededBy

public IloBool isSucceededBy(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const

This member function returns IloTrue if the resource constraint srct2 succeedes the resource constraint srct1 in the invoking scheduler solution, that is if a successor relation has been added with the member function setSuccessor. Otherwise it returns IloFalse.


isTeardown

public IloBool isTeardown(const IloResourceConstraint rct) const

This member function returns IloTrue if rct is the teardown (that is, the last) resource constraint of its resource in the invoking scheduler solution. Otherwise, it returns IloFalse.

This member function should be used only if rct is stored in the invoking scheduler solution.


makeClone

public IloSchedulerSolution makeClone(IloEnv e) const

This member function allocates a new solution on e and adds to it all objects that were added to the invoking object. The newly created solution is returned.


remove

public void remove(IloModel m) const

This member function removes all scheduler extractables (such as IloActivity, IloResourceConstraint, IloResource and its subclasses) that have been explicitly added to the model from the invoking scheduler solution.


setCapacityMax

public void setCapacityMax(const IloResourceConstraint ct, IloNum max) const

This member function changes the maximal capacity of ct in the invoking scheduler solution to max.

This member function should be used only if ct is stored in the scheduler solution.


setCapacityMin

public void setCapacityMin(const IloResourceConstraint ct, IloNum min) const

This member function changes the minimal capacity of ct in the invoking scheduler solution to min.

This member function should be used only if ct is stored in the scheduler solution.


setDurationMax

public void setDurationMax(const IloActivity activity, IloNum max) const

This member function changes the maximal duration of activity in the invoking scheduler solution to max.

This member function should be used only if activity is stored in the scheduler solution.


setDurationMin

public void setDurationMin(const IloActivity activity, IloNum min) const

This member function changes the minimal duration of activity in the invoking scheduler solution to min.

This member function should be used only if activity is stored in the scheduler solution.


setEndMax

public void setEndMax(const IloActivity activity, IloNum max) const

This member function changes the maximal end time of activity in the invoking scheduler solution to max.

This member function should be used only if activity is stored in the scheduler solution.


setEndMin

public void setEndMin(const IloActivity activity, IloNum min) const

This member function changes the minimal end time of activity in the invoking scheduler solution to min.

This member function should be used only if activity is stored in the scheduler solution.


setExternalVariableMax

public void setExternalVariableMax(const IloActivity activity, IloNum max) const

This member function changes the maximal value of the external variable of activity in the invoking scheduler solution to max. This member function should be used only if activity is stored in the scheduler solution.


setExternalVariableMin

public void setExternalVariableMin(const IloActivity activity, IloNum min) const

This member function changes the minimal value of the external variable of activity in the invoking scheduler solution to max.

This member function should be used only if activity is stored in the scheduler solution.


setLevelMax

public void setLevelMax(const IloResource resource, IloNum start, IloNum end, IloNum max) const

This member function changes the maximal level of resource in the invoking scheduler solution to max during the interval [start end]. For this purpose, the internal step function for the stored maximal level of the resource is modified.

This member function should be used only if resource is stored in the scheduler solution and contains information about capacity levels.


setLevelMin

public void setLevelMin(const IloResource resource, IloNum start, IloNum end, IloNum min) const

This member function changes the minimal level of resource in the invoking scheduler solution to min during the interval [start end]. For this purpose, the internal step function for the stored minimal level of the resource is modified.

This member function should be used only if resource is stored in the scheduler solution and contains information about capacity levels.


setLevelsStoredWithBounds

public void setLevelsStoredWithBounds(const IloResource res, IloBool withBounds=IloTrue) const

If withBounds is equal to IloTrue, this member function sets the storage mode of res to be “with bounds.” At the construction of the scheduler object, the default mode is “without bounds.” See the section "Storing Objects" at the start of this class for more information.

This member function should be used only if res is stored in the scheduler solution and contains information about capacity levels.


setNext

public void setNext(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const

If the resource constaint srct1 is stored in the invoking scheduler solution, this member function makes srct2 the next resource constraint of srct1 in the invoking scheduler solution. Similarly, if the resource constraint srct2 is stored in the invoking scheduler solution, this member function makes srct1 the previous of srct2.

Next and previous are restored only on unary resources.


setNonRestorable

public void setNonRestorable(IloResourceConstraint rc) const

This member function sets rc as non-restorable. No fields of this resource constraint will be restored. This method is equivalent to setRestorable(rc, IloRestoreNothing);


setNonRestorable

public void setNonRestorable(IloActivity activity) const

This member function sets activity as non-restorable. No fields of this activity will be restored. This method is equivalent to setRestorable(activity, IloRestoreNothing);


setProcessingTimeMax

public void setProcessingTimeMax(const IloActivity activity, IloNum max) const

This member function changes the maximal processing time of activity in the invoking scheduler solution to max.

This member function should be used only if activity is stored in the scheduler solution.


setProcessingTimeMin

public void setProcessingTimeMin(const IloActivity activity, IloNum min) const

This member function changes the minimal processing time of activity in the invoking scheduler solution to min.

This member function should be used only if activity is stored in the scheduler solution.


setRestorable

public void setRestorable(IloResourceConstraint rc, IloInt storeFields) const

This member function sets the data fields that will be restored for rc in the context of local search, the IloRestoreSolution goal, IloSolution::getConstraint, and IloSolution::restore. Valid values of storeFields are IloRestoreNothing, IloRestoreAll, and any bitwise-OR combination of IloRestoreRCNext, IloRestoreRCDirectSuccessor, IloRestoreRCSetup, IloRestoreRCTeardown, IloRestoreRCCapacity, and IloRestoreRCSelected.


setRestorable

public void setRestorable(IloActivity activity, IloInt storeFields) const

This member function sets the data fields that will be restored for activity in the context of local search, the IloRestoreSolution goal, IloSolution::getConstraint, and IloSolution::restore. Valid values of storeFields are IloRestoreNothing, IloRestoreAll, and any bitwise-OR combination of IloRestoreActivityStart, IloRestoreActivityEnd, IloRestoreActivityDuration, IloRestoreActivityProcessingTime, IloRestoreActivityExternal.


setSelected

public void setSelected(IloResourceConstraint rct, const IloResource resource) const

This member function sets the selected resource of rct in the invoking scheduler solution to resource. If the resource constraint is a setup (resp. teardown) resource constraint and if the resource is stored in the invoking scheduler solution, then the member function getSetupRC (resp. getTeardownRC) returns the resource constraint rct.

This member function should be used only if rct is stored in the scheduler solution.


setSetup

public void setSetup(const IloResourceConstraint rct) const

This member function makes rct a setup resource constraint in the invoking scheduler solution. If the resource constraint has a selected resource and if this selected resource is stored in the invoking scheduler solution, then the member function getSetupRC returns the resource constraint rct.

This member function should be used only if rct is stored in the invoking scheduler solution.

Setups are only restored on unary resources.


setStartMax

public void setStartMax(const IloActivity activity, IloNum max) const

This member function changes the maximal start time of activity in the invoking scheduler solution to max.

This member function should be used only if activity is stored in the scheduler solution.


setStartMin

public void setStartMin(const IloActivity activity, IloNum min) const

This member function changes the minimal start time of activity in the invoking scheduler solution to min.

This member function should be used only if activity is stored in the scheduler solution.


setSuccessor

public void setSuccessor(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const

If the resource constaint srct1 is stored in the invoking scheduler solution, this member function makes srct2 a successor of srct1 in the invoking scheduler solution. Similarly, if the resource constraint srct2 is stored in the invoking scheduler solution, this member function makes srct1 a predecessor of srct2.


setTeardown

public void setTeardown(const IloResourceConstraint rct) const

This member function makes rct a teardown resource constraint in the invoking scheduler solution. If the resource constraint has a selected resource and if this selected resource is stored in the invoking scheduler solution, then the member functions getTeardownRC returns the resource constraint rct.

This member function should be used only if rct is stored in the invoking scheduler solution.

Teardowns are only restored on unary resources.


store

public void store(const IloResourceConstraint ct, const IlcScheduler scheduler) const

This member function stores ct in the invoking scheduler solution. The minimal and maximal capacities of the ct are also stored. The data stored is that which is present in the current search state of scheduler.


store

public void store(const IloResource resource, const IlcScheduler scheduler) const

This member function stores resource in the invoking scheduler solution.

If the resource has a precedence graph, then the resource constraints that actually execute on the resource are stored. The resource constraints that are stored are only those that are part of the model: if the solver has created resource constraints during the search, they will not be added to the solution. In addition, the precedence order between those resource constraints (if present) is stored.


store

public void store(const IloActivity activity, const IlcScheduler scheduler) const

This member function stores activity in the invoking scheduler solution. The minimal and maximal values for start time, end time, processing time, duration, and external variable are stored. The data stored is that which is present in the current search state of scheduler.


store

public void store(const IlcScheduler scheduler) const

This member function calls the IloSolution::store(IloAlgorithm) function on the internal IloSolution. That function stores the data (from the algorithm) for each object that:

The data stored is that which is present in the current search state of scheduler.


unsetNext

public void unsetNext(const IloResourceConstraint rct) const

This member function removes all the next resource constraints of rct in the invoking scheduler solution. Consistency is maintained; that is, the resource constraint rct is no longer a previous resource constraint of its former next resource constraints.

This member function should be used only if rct is stored in the invoking scheduler solution.


unsetNext

public void unsetNext(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const

This member function removes the next edge, if it exists, between srct1 and srct2 in the invoking schedule solution. Consistency is maintained; that is, srct1 is no longer a previous resource constraint of srct2.


unsetPrecedences

public void unsetPrecedences()

This member function removes all the successors and all the predecessors of all resource constraints that are stored in the invoking scheduler solution.


unsetPrecedences

public void unsetPrecedences(const IloResource resource)

This member function removes all the successors and all the predecessors of all resource constraints that have resource as the selected resource in the invoking scheduler solution.

This member function should be used only if rct is stored in the invoking scheduler solution.


unsetPredecessors

public void unsetPredecessors(const IloResourceConstraint rct) const

This member function removes all the predecessors of rct in the invoking scheduler solution. Consistency is maintained; that is, the resource constraint rct is no longer a successor of its former predecessors.

This member function should be used only if rct is stored in the invoking scheduler solution.


unsetPrev

public void unsetPrev(const IloResourceConstraint rct) const

This member function removes all the previous resource constraints of rct in the invoking scheduler solution. Consistency is maintained; that is, the resource constraint rct is no longer a next resource constraint of its former previous resource constraints.

This member function should be used only if rct is stored in the invoking scheduler solution.


unsetSelected

public void unsetSelected(const IloResourceConstraint rct) const

This member function removes the selected resource of rct in the invoking scheduler solution. If the resource constraint is a setup (resp. teardown) resource constraint and if its former selected resource is stored in the invoking scheduler solution, then the member function getSetupRC (resp. getTeardownRC) will no longer return the resource constraint rct.

This member function should be used only if rct is stored in the scheduler solution.


unsetSequence

public void unsetSequence(const IloResource resource)

This member function removes all the next, previous, setup and teardown of all resource constraints that have resource as the selected resource in the invoking scheduler solution.

This member function should be used only if rct is stored in the invoking scheduler solution.


unsetSequences

public void unsetSequences()

This member function removes all the next, previous, setup and teardown of all resource constraints that are stored in the invoking scheduler solution.


unsetSetup

public void unsetSetup(const IloResourceConstraint rct) const

This member function removes rct as a setup resource constraint in the invoking scheduler solution. If the resource constraint has a selected resource and if this selected resource is stored in the invoking scheduler solution, then the member function getSetupRC will no longer return the resource constraint rct.

This member function should be used only if rct is stored in the invoking scheduler solution.


unsetSuccessor

public void unsetSuccessor(const IloResourceConstraint srct1, const IloResourceConstraint srct2) const

This member function removes the precedence relation between srct1 and srct2 from the invoking scheduler solution, if this edge exists. As a consequence, srct2 is no longer a successor of srct1 in the invoking scheduler solution nor is srct1 a predecessor of srct2.


unsetSuccessors

public void unsetSuccessors(const IloResourceConstraint rct) const

This member function removes all the successors of rct in the invoking scheduler solution. Consistency is maintained; that is, the resource constraint rct is no longer a predecessor of its former successors.

This member function should be used only if rct is stored in the invoking scheduler solution.


unsetTeardown

public void unsetTeardown(const IloResourceConstraint rct) const

This member function removes rct as a teardown resource constraint in the invoking scheduler solution. If the resource constraint has a selected resource and if this selected resource is stored in the invoking scheduler soluiton, then the member function getTeardownRC will no longer return the resource constraint rct.

This member function should be used only if rct is stored in the invoking scheduler solution.


Inner Enumeration Detail

Enumeration IloResourceConstraintIteratorFilter

Definition file: ilsched/ilosolution.h
Include file: <ilsched/ilosolution.h>

The enumeration IloResourceConstraintIteratorFilter can be used to create a IloSchedulerSolution::ResourceConstraintIterator that traverses a specifed set of resource constraints such as the predecessors or the successors. The possible values are described below.

IloPredecessors indicates that the iterator will traverse the set of resource constraints that are predecessors of a given resource constraint.

IloSuccessors indicates that the iterator will traverse the set of resource constraints that are direct successors of a given resource constraint.

IloPrevious indicates that the iterator will traverse the set of resource constraints that are previous of a given resource constraint.

IloNext indicates that the iterator will traverse the set of resource constraints that are next of a given resource constraint.

See Also:

Fields

IloPredecessors = 0 
IloSuccessors = 1 
IloPrevious = 2 
IloNext = 3