Activity-aware utility functions¶
Utility functions to visualize various kinds of data in a Cell DEVS way, that is: by creating a matrix containing single values. This matrix can then be processed by e.g. gnuplot to create a heatmap. Note that it is limited to 2D maps, as these are the most frequent and simplest to conceptually grasp.
These functions are supposed to be used later on in development for the Activity-Aware part.
- pypdevs.activityVisualisation.visualizeActivity(sim)[source]¶
Visualize the activity in a Cell DEVS way
- Parameters
sim – the simulator object, to access the model and their activity
- pypdevs.activityVisualisation.visualizeLocations(kernel)[source]¶
Visualize the locations in a Cell DEVS way
- Parameters
kernel – a basesimulator object, to fetch the location of every model
- pypdevs.activityVisualisation.visualizeMatrix(matrix, formatstring, filename)[source]¶
Perform the actual visualisation in a matrix style
- Parameters
matrix – the 2D matrix to visualize, should be a list of lists
formatstring – the string to use to format the values, most likely something like “%f”
filename – file to write the matrix to. Can be both a string to create a new file with that name, or an opened file handle.