getFormulation()This method gets the entire formulation as a single dictionary-like object.
setFormulation(Dictionary formulation)This method sets the formulation based on a JSON object describing the entire formulation.
setFormulation() expects an object with the same structure as the
object it returns.
selectConstraints(Callable selector)This method selects all constraints matching a specified selector.
LESS_THAN :def lessThanTest(constraint): return constraint["type"] == "LESS_THAN" ltConstraints = FormulationAPI.selectConstraints(lessThanTest) selectObjectives(Callable selector)This method selects all objectives matching a specified selector.
MAXIMIZE :def maximizeTest(objective): return objective["type"] == "MAXIMIZE" maxObjectives= FormulationAPI.selectObjectives(maximizeTest) removeConstraint(String paramId, String type)This method removes a constraint specified by a dictionary-like object containing parameter ID and type from the formulation.
paramId is the id attribute on the parameter objects
used by methods in the Parameter API.
addConstraint(String paramId, String type, Number boundValue, List<Number> range)This method adds a constraint specified by a dictionary-like object containing the parameter ID, type, and value to the formulation.
paramId is the id attribute on the parameter objects
used by methods in the Parameter API.
addObjective(String paramId, String type, Number value, Number rank)This method adds an objective specified by a JSON object containing parameter ID, type, rank, and value to the formulation.
paramId is the id attribute on the parameter objects
used by methods in the Parameter API.
removeObjective(String paramId)This method removes an objective specified by a parameterID from the formulation.
paramId is the id attribute on the parameter objects
used by methods in the Parameter API.
getObjectiveIterator()This method gets the ID for an iterator over the set of objectives.
getConstraintIterator()This method gets the ID for an iterator over the set of constraints.
next(String iteratorId)This method gets the next item for either a constraint or an objective iterator.
hasNext(String iteratorId)This method verifies if a specified iterator has a next item.
getConstraintsForParameter(String paramId)This method gets all constraints for a specified parameter.
paramId is the id attribute on the parameter objects
used by methods in the Parameter API.
getObjectiveForParameter(String paramId)This method gets all objectives for a specified parameter.
paramId is the id attribute on the parameter objects
used by methods in the Parameter API.
|