Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a established data structure for place/transition petri-nets?
    primarykey
    data
    text
    <p>I'm trying to come up with an elegant solution for representing place/transition petri nets. So far I save them as follows:</p> <pre><code>{:netname {:places {:name tokens, ...} :transitions #{:t1, :t2, :t3, ...} :edges_in #{[:from :to tokens], ...} :edges_out #{[:from :to tokens], ...}}} </code></pre> <p><code>tokens</code> is a number, everything starts with a symbol with the corresponding name.</p> <p>//edit - Some more clarification: The :netname and :name are unique, because it has to be possible to merge 2 nets, where the places again have to have unique names. The numerical tokens are determined by the user of the petri nets during creation of a place or edge.</p> <p>I would be thankful for some pointers or links to a more elaborate / better data structure for my problem.</p> <p>//edit 2 - I reworked my first take on the data-structure, because of the uniquenes of place-names. :places now references a hashmap. Also edges_in and out are now hashmaps, because every edge is unique with its origin, destination and token number.</p> <p>//edit 3 - The use of the structure: It is read and written to in the same quantity i would say. The way a petri net is used, there is a back and forth between modifying the net and reading it, with maybe slightly more reading towards the end.</p> <p>I also modified my structure above slightly, so :edges_in and :edges_out now saves the triplets as a vector instead of a list. This simplyfies saving the hashmap to file and reading it from it, because <code>load-string</code> evaluates lists as expressions.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload