Previous topic

Geotable

Next topic

Operation model library

This Page

Management Model LibraryΒΆ

Management models are used for modifying SIMO data hierarchies, such as removing objects constructing new objects and grouping objects.

All management model functions should have the following parameters:

  • sim – simulator instance (for details, see simo.simulation.sim.py)
  • depthind – current model chain depth index as int
  • params – management model parameters in a dictionary
  • tind – target object index as a 2d numpy array (for details, see simo.matrix.handler.py)

Below is a simple example of a management model for removing each object from current simulation level. The model implementation can utilize the public object attributes and methods of simulator and data handler:

def remove_objects_from_current_level(sim, depthind, params, tind, toremove):
    """Remove objects from current evaluation level

    sim -- simulator instance
    depthind -- current model chain depth index as int
    params -- management model parameters
    tind -- target index
    """
    # get the level that all objects should be removed from
    level = sim.level
    for i in range(tind.shape[0]):
        it, br, o = tind[i,0:3]
        sim.data.del_objects(it, br, level, [o])