Given the code below (example from:https://www.ibm.com/docs/en/icos/20.1.0?topic=f-pulse)
from docplex.cp.model import CpoModel, INTERVAL_MAX
import docplex.cp.utils_visu as visu
mdl = CpoModel()
a1=mdl.integer_var(name="a1")
a=mdl.interval_var(size=(1,10),end=(0,14),name="a")
b=mdl.interval_var(size=(1,10),end=(0,14),name="b")
c=mdl.interval_var(size=(1,10),end=(0,14),name="c")
d=mdl.interval_var(size=(1,10),end=(0,14),name="d")
// Horizon of the schedule is 14
// Cumul function resourceUse represents the level of a discrete resource.
// Activities a1,a2,a3,a4 require between 1 and 10 units of resource
resourceUse = mdl.pulse(a, 1,10) + mdl.pulse(b,1,10) + mdl.pulse(c, 1,10) + mdl.pulse(d, 1,10)
mdl.add(mdl.size_of(a)*mdl.height_at_start(a,resourceUse) >= 22)
mdl.add(mdl.size_of(b)*mdl.height_at_start(b,resourceUse) >= 22)
mdl.add(mdl.size_of(c)*mdl.height_at_start(c,resourceUse) >= 22)
mdl.add(mdl.size_of(d)*mdl.height_at_start(d,resourceUse) >= 22)
mdl.add(resourceUse<=7)
# Solve model
print("Solving model....")
msol = mdl.solve(FailLimit=100000, TimeLimit=10,execfile='/opt/ibm/ILOG/CPLEX_Studio201/cpoptimizer/bin/x86-64_linux/cpoptimizer')
print("Solution: ")
msol.print_solution()
output
a: (start=6, end=14, size=8, length=8)
b: (start=0, end=8, size=8, length=8)
c: (start=0, end=6, size=6, length=6)
d: (start=8, end=14, size=6, length=6)
Since the resource used is between 1 and 10, is there a way to know the exact number of resoruce use given the solution?