didppy.ElementTable
- class didppy.ElementTable
Table of element constants.
t[index]
returns an element expression referring to an item wheret
isElementTable
andindex
is a sequence ofElementExpr
,ElementVar
,ElementResourceVar
, orint
.Examples
>>> import didppy as dp >>> model = dp.Model() >>> obj = model.add_object_type(number=2) >>> var = model.add_element_var(object_type=obj, target=1) >>> table = model.add_element_table({(0, 0, 0, 0): 1, (1, 1, 1, 1): 3}, default=2) >>> table[0, var, 1, 0].eval(model.target_state, model) 2
Methods