VMO_Score.utils

Module implementing some useful methods.

Functions

generate_configuration(filepath, pn) Generate a configuration file for the Petri Net.
load_configuration(filepath) Load a configuration file.
load_shelve(filepath, field) Load a file into an object.
save_shelf(filepath, field, obj) Save an object into a file.
VMO_Score.utils.generate_configuration(filepath, pn)[source]

Generate a configuration file for the Petri Net.

Parameters:
  • filepath (str) – String representing the path of the output
  • pn (PetriNet) – A Petri Net
VMO_Score.utils.load_configuration(filepath)[source]

Load a configuration file.

Parameters:filepath – String representing the path of the configuration file
Returns:Dictionary representing the configuration file
Return type:dict
VMO_Score.utils.load_shelve(filepath, field)[source]

Load a file into an object.

Parameters:
  • filepath (str) – String representing the path of the file
  • field (str) – identifier of the object
Returns:

Dictionary representing the object

Return type:

dict

VMO_Score.utils.save_shelf(filepath, field, obj)[source]

Save an object into a file.

Parameters:
  • filepath (str) – Path of the file
  • field (str) – Id of the object in the file
  • obj (object) – Object to be saved