[Pntool-developers] SF.net SVN: pntool:[242] codegen/supervisor_algorithm.txt
Brought to you by:
compaqdrew,
miordache
From: <com...@us...> - 2009-08-23 07:45:45
|
Revision: 242 http://pntool.svn.sourceforge.net/pntool/?rev=242&view=rev Author: compaqdrew Date: 2009-08-23 07:45:39 +0000 (Sun, 23 Aug 2009) Log Message: ----------- reservation internals Modified Paths: -------------- codegen/supervisor_algorithm.txt Modified: codegen/supervisor_algorithm.txt =================================================================== --- codegen/supervisor_algorithm.txt 2009-08-23 07:45:34 UTC (rev 241) +++ codegen/supervisor_algorithm.txt 2009-08-23 07:45:39 UTC (rev 242) @@ -18,7 +18,7 @@ ___?25:3-0,4-1,5-2,6-2\n <--several options here or ___?30:2-1\n <--only one option here -Using the [reservation-id]:[label number]-[transition number] syntax. Comma separated where applicable. Reservation-id is a unique unsigned char associated with a reservation for its lifetime. Typically token numbers are used, although any unique char is valid with respect to the supervisor. +Using the [reservation-id]:[label number]-[transition number] syntax. Comma separated where applicable. Reservation-id is a unique unsigned char associated with a reservation for its lifetime. Typically token numbers are used, although any unique char (unique plant-wide) is valid with respect to the supervisor. Once a reservation is made, the supervisor will examine its list of outstanding reservations and resolve them in a first-come, first-serve manner. In the first example, the supervisor might respond: @@ -46,3 +46,15 @@ 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. +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. + +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 + +LOCAL SIMULATION + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |