[Pntool-developers] SF.net SVN: pntool:[243] codegen/supervisor_algorithm.txt
Brought to you by:
compaqdrew,
miordache
From: <com...@us...> - 2009-08-23 07:45:51
|
Revision: 243 http://pntool.svn.sourceforge.net/pntool/?rev=243&view=rev Author: compaqdrew Date: 2009-08-23 07:45:43 +0000 (Sun, 23 Aug 2009) Log Message: ----------- Local simulation Modified Paths: -------------- codegen/supervisor_algorithm.txt Modified: codegen/supervisor_algorithm.txt =================================================================== --- codegen/supervisor_algorithm.txt 2009-08-23 07:45:39 UTC (rev 242) +++ codegen/supervisor_algorithm.txt 2009-08-23 07:45:43 UTC (rev 243) @@ -44,17 +44,27 @@ Then the reservation has been cancelled. The reservation-id may also be re-used. -Instead, the supervisor could send you a Y message, in which case the plant needs to respect it and fire the appropriate transition. Reservations are not canceled until the plant receives notification of such. +Instead, the supervisor could send a Y message, in which case the plant needs to respect it and fire the appropriate transition. Reservations are not canceled until the plant receives notification of such. RESERVATION INTERNALS When the supervisor receives a reservation request, it places a reservation into a hashmap and for each option communicated by the plant, a fire_something associated with that reservation. For instance, if a plant makes a reservation with five transitions, a single reservation struct with five child fire_something structs will be created. -Periodically, the supervisor polls its list of outstanding reservations (close_reservation_pass), and attempts to resolve it by iterating through the fire_something list to see if a transition can be fired (attempt_close_reservation). If it can be fired, it immediately halts its search, informs the plant that reservation has been resolved (and informs the plant which transition has been selected), immediately halts its own simulation (by setting the somebodys_firing_transition to a non-zero value) and waits for the plant to indicate the fire was successful. +Periodically, the supervisor polls its list of outstanding reservations (close_reservation_pass), and attempts to resolve reservations by iterating through the fire_something list to see if a transition can be fired (attempt_close_reservation). If it can be fired, it immediately halts its search, informs the plant that reservation has been resolved (and informs the plant which transition has been selected), immediately halts its own simulation (by setting the somebodys_firing_transition to a non-zero value) and waits for the plant to indicate the fire was successful. A reservation can be fired iff >=1 of the following cases hold (attempt_fire_something): A) The supervisor has no matching label B) The supervisor has a transition with a matching label and that transition is able to fire +I believe the current plant implementation queries the supervisor for every transition (whether the supervisor is interested or not). This behavior is not strictly required by the supervisor. + +I believe the current plant implementation sends only one transition choice to the supervisor, while the supervisor supports a list priority for transition choices as described above. + LOCAL SIMULATION +The supervisor has a full petri net simulation implementation, meaning that places and transitions that are not tied to external plants behave as expected. The supervisor iterates through tokens and transitions (simulation_pass_local) and fires all fireable transitions. +If a transition is blocked (at compile-time, i.e. a plant shares its label), it is not fired during local simulation. These transitions are only fired with the reservation system. +If a transition does not have enough input tokens in the correct input places, it will not fire. +Otherwise, the transition will fire. + +At this point, the input tokens are destroyed and the new tokens are created. Since the supervisor operates on a single thread, there's no danger of concurrency problems. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |