|
| | PetriNet (const std::set< std::string > &petri_net_xmls, const std::string &case_id, std::shared_ptr< TaskSystem > threadpool, const Marking &goal_marking={}, const PriorityTable &priorities={}) |
| | Construct a new PetriNet object from a set of paths to PNML- or GRML-files. Since PNML-files do not have priorities; you can optionally add a priority table manually.
|
| | PetriNet (const Net &net, const std::string &case_id, std::shared_ptr< TaskSystem > threadpool, const Marking &initial_marking, const Marking &goal_marking={}, const PriorityTable &priorities={}) |
| | Construct a new PetriNet object from a net and initial marking.
|
| std::function< void()> | getInputTransitionHandle (const std::string &transition) const noexcept |
| | By registering a input transition you get a handle to manually force a transition to fire. It returns a callable handle that will schedule a reducer for the transition, generating tokens. This only works for transitions that have no input places.
|
| void | registerCallback (const std::string &transition, Callback &&callback) const noexcept |
| | The default transition payload (DirectMutation) is overloaded by the Callback supplied for a specific transition.
|
| bool | tryRegisterCallback (const std::string &transition, Callback &&callback) const noexcept |
| | Same as registerCallback, but reports whether the Callback was actually registered.
|
| std::vector< Transition > | getUnregisteredTransitions () const noexcept |
| | Get the transitions that still have the default payload (DirectMutation), i.e. transitions for which no Callback has been registered. An empty result means all transitions are registered.
|
| template<typename T, typename... Args> |
| void | registerCallbackInPlace (const std::string &transition, Args &&...args) const noexcept |
| | Construct a Callback of type T in place. This is required for type that are not moveable;.
|
| Marking | getMarking () const noexcept |
| | Get the Marking object. This function is thread-safe and be called during PetriNet execution.
|
|
std::vector< Transition > | getActiveTransitions () const noexcept |
| | Get the list of active transitions. This function is thread-safe and be called during PetriNet execution.
|
| bool | reuseApplication (const std::string &case_id) |
| | reuseApplication resets the PetriNet such that the same net can be used again after a cancel call or natural termination of the PetriNet. You do need to supply a new case_id which must be different.
|
PetriNet exposes the possible constructors to create PetriNets. It also allows the user to register a Callback to a transition, or to get a handle for input-transitions.