Releases: joergen7/gen_pnet
Releases · joergen7/gen_pnet
0.1.7
0.1.6
0.1.5
This release fixes a condition where the marking of a net could be observed in an inconsistent state because a transition already consumed from its preset but did not yet produce to its postset. Now, consuming and producing are atomic and intermediate states cannot be observed anymore.
0.1.4
0.1.3
0.1.2
0.1.1
The gen_pnet library which is a generic OTP behavior for defining and running Petri nets has been released updating it to version 0.1.1. It is also available as a hex.pm package.
Changes
- The callbacks have been separated into a structural part which describes the petri net structure and initial marking and an interface part which describes the net instance's appearance as an Erlang actor. However, it is still possible to provide all callback functions in a single module by implementing the
gen_pnet
behavior. - The net does not carry an extra user-info term anymore. Now, all state must be encoded in the Petri net marking.
- The callback
enum_consume_map/3
which expected you to enumerate all firing modes enabling a particular transition has been replaced withis_enabled/2
which lets you returntrue
orfalse
to signal whether a transition is enabled in a given firing mode or not. - The execution semantics now depend on the
lib_combin
libary to enumerate possible firing modes. - The initial marking given in the Petri net structure can now be superimposed with a marking defined at net instance start time.
- The
get_marking_map/2
function has been replaced withmarking/1
which returns the global state of the net. - The functions
produce/2
,consume/2
, andadd/3
have been removed from the API because they allow the net state to be directly updated from the outside. Outside requests must be handled with thehandle_call/3
,handle_cast/2
, andhandle_info/2
interface callbacks now. - The execution of the Petri net is now completely sequential. The
gen_pnet
behavior can, thus, serve as a baseline for parallel implementations to benchmark against. - The Petri net structure has been extended with the
init_marking/1
callback which allows the definition of the initial marking per place, replacing theinit/1
callback which expected you to generate the initial marking as a marking map in a single call. - Hot code reload is now possible via the
code_change/3
callback which is handed up as is to the underlyinggen_server
behavior. - On stopping the module, additional side effects can be generated by implementing the
terminate/2
callback which is handed up as is to the underlyinggen_server
behavior. - Any token to be generated as part of a net state update can now be defined to generate additional side effects by implementing the
trigger/2
callback accordingly. Afterwards, the token can be produced normally or can be dropped. - The interface has been extended to expose the functionality of the underlying
gen_server
behavior and also to hide the particularities of Petri net form and semantics to the outside, making the interface as similar to thegen_server
behavior as possible. This means that the interface callbacks have been extended to include thehandle_call/3
,handle_cast/2
, andhandle_info/2
callbacks.
0.1.0-release
The gen_pnet library in its original shape.