IBM ILOG Scheduler User's Manual > Integrated Applications > Scheduling with State Resources: the Trolley Problem, with Transition Times and Limited Capacity > Representing State Resource with Limited Capacity > Resource Modeling

The maximal capacity constraint is represented by defining a discrete resource associated with the trolley. This resource is defined in the function DefineModel as follows.

  /* CREATE THE TROLLEY CAPACITY RESOURCE */
  IloDiscreteResource trolleyCapacity(env,trolleyMaxCapacity);

Let's see now how this discrete resource is used by the activities.