IBM ILOG Scheduler User's Manual > Getting Started with Scheduler > Using Discrete Resources > Working with Discrete Resources > Define the Problem, Design a Model |
Define the Problem, Design a Model |
INDEX
![]() |
Because the workers in this problem are considered to be identical, we can represent them as a discrete resource with a capacity of 2. Each activity requires one of the workers.
The following code creates the workers as an instance of IloDiscreteResource
with a capacity of 2.
/* CREATE THE RESOURCE. */ IloDiscreteResource workers(env, 2); |
The resource constraints are once again declared using the method IloActivity::requires
, which states that the invoking activity requires the capacity of the given resource (workers
) from the beginning to the end of its execution. Because the default capacity of the method requires
is 1, the capacity required by the activity does not have to be stated.
Our objective is still to minimize the makespan for the project. IloMinimize
is used just as for the previous example.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |