Struct pnets::timed::Net [−][src]
pub struct Net { pub name: String, pub transitions: IndexVec<TransitionId, Transition>, pub places: IndexVec<PlaceId, Place>, // some fields omitted }
Expand description
Timed Petri net, with produce, consume, condition and inhibitors arcs
This structure is indexed with PlaceId
and TransitionId
to allow easy access to places
and transitions.
As this kind of network is a superset of standard Petri net, we can create one from standard Petri net without loosing any informations.
Fields
name: String
Name of this network
transitions: IndexVec<TransitionId, Transition>
Transitions of the network
places: IndexVec<PlaceId, Place>
Places of the network
Implementations
Create a place with automatic name
Create a transition with an empty name
Get node name with its id
Get node id with its name
Add an arc in the network. This kind of network support only arc::Kind::Consume
,
arc::Kind::Produce
, arc::Kind::Inhibitor
and arc::Kind::Test
arcs.
Errors
Return NetError::UnsupportedArc
when trying to add a kind of arc which is not supported
Disconnect a place in the network
The place is not really deleted to avoid memory relocation and extra information about this place such as name can be useful later.
Disconnect a transition in the network
The transition is not really deleted to avoid memory relocation and extra information about this transitions such as name can be useful later.
Add a priority relation in the network
Trait Implementations
type Output = Transition
type Output = Transition
The returned type after indexing.
Performs the indexing (container[index]
) operation. Read more
Performs the mutable indexing (container[index]
) operation. Read more