VMO_Score.improviser

Module implementing methods for the off-line improvisation with an existing Petri net

Classes

Improviser(pn, path_conf) Class representing the off-line improviser
defaultdict defaultdict(default_factory[, ...]) –> dict with default factory
class VMO_Score.improviser.Improviser(pn, path_conf)[source]

Class representing the off-line improviser

add_action(addr, value)[source]

Add a user action to the Petri Net.

Add a new token to the place that represents the actions sent by the environment,

Parameters:
  • addr (str) – String representing the OSC address of the message
  • value (str) – String representing the OSC value of the message
current_time

float – the amount of time that has elapsed

delete_action(addr, value)[source]

Remove a user action from the Petri Net

Remove a token from the place that represents the actions sent by the environment.

Parameters:
  • addr (str) – String representing the OSC address of the message
  • value (str) – String representing the OSC value of the message
fire_transition(t_name)[source]

Fire a transition

Take randomly a mode of an enabled transition and fire it

Parameters:t_name (str) – Name of the transition to be fired
get_enabled_transitions()[source]

Enabled transitions

Return a list of enabled transitions with the current marking

is_final_marking()[source]

Return if the current state of the Petri Net is a final state

Returns:The Petri Net is in a final state
Return type:bool
make_step()[source]

Make a step in a Petri Net

Take a logical step in the Petri Net. That is, an enabled transition is taken randomly and then it is fired.

next_time_unit()[source]

Increment the global clock and the transition time by one time-unit

pn

PetriNet – the Petri net for improvisation

restart()[source]

Restart to the initial marking of the Petri Net