4.1.8.2. causality/EventTrace¶
- class causality.EdgeAction¶
- __init__()¶
- __init__(e)
- edge¶
(Read-only) the hyperedge for the action. May not be null.
- Type:
- void applyTo(m) const
Perform
m.fire(edge)
.- Parameters:
m (Marking) – the marking to apply the action to.
- class causality.InputAction¶
- __init__()¶
- __init__(v)
- void applyTo(m) const
Perform m.add(vertex, 1).
- Parameters:
m (Marking) – the marking to apply the action to.
- class causality.OutputAction¶
- __init__()¶
- __init__(v)
- void applyTo(m) const
Perform m.remove(vertex, 1).
- Parameters:
m (Marking) – the marking to apply the action to.
- class causality.EventTrace¶
A representation of a trace of events starting from an initial marking. An event is either a reaction/hyperedge being performed or a transfer of tokens out or in to the system.
- __init__(initialState)¶
Construct an empty event trace with an initial state. A copy of the given marking is being stored.
- Parameters:
initialState (Marking) – the marking to used as the initial state.
- __getitem__()¶
- Returns:
the
i
th event in the trace.- Return type:
- Raises:
LogicError
ifi
is out of bounds.
- __eq__()¶
Calls
syncSize()
on the internal initial state and the underlying net.
- add(time, action)¶
Append an event to the trace.
- Parameters:
time (float) – the time associated with the event.
action (EdgeAction or InputAction or OutputAction) – the action of the event.
- Raises:
LogicError
if the time is less than the current time of the trace.- Raises:
LogicError
if the action has null descriptors.- Raises:
LogicError
if the descriptors in the action does not belong to the underlying derivation graph.
- print(printer=EventTracePrinter())¶
Create a plot of the counts throughout the event trace at each time point.
- Returns:
the filename for the PDF that will be compiled by the post processor.
- Return type:
- dump()¶
- dump(filename)
Dump the initial marking and list of events to a file. This file can be loaded in again.
- Parameters:
filename (str) –
the name of the file to save the dump to. If non is given an auto-generated name in the
out/
folder is used. If an empty string is given, it is treated as if non is given.Note
The filename is being used literally, i.e., it is not being prefixed according to the current script location as input filenames are.
- Returns:
the filename with the dumped model.
- Return type:
- static load(dg, f)¶
- static load(net, f)
Load an event trace dump.
- Parameters:
- Returns:
the loaded event trace.
- Return type:
- Raises:
LogicError
ifdg
/net
isNone
.- Raises:
InputError
on bad data or if the given derivation graph does not match the data.