didppy.ElementTable2D

class didppy.ElementTable2D

2-dimensional table of element constants.

t[x, y] returns an element expression referring to an item where t is ElementTable2D and x and y are ElementExpr, ElementVar, ElementResourceVar, or int.

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([[2, 3], [0, 1]])
>>> table[0, var].eval(model.target_state, model)
3

Methods