As of August 2024, International Journal "Notes on Intuitionistic Fuzzy Sets" is being indexed in Scopus.
Please check our Instructions to Authors and send your manuscripts to nifs.journal@gmail.com. Next issue: September/October 2024.

Open Call for Papers: International Workshop on Intuitionistic Fuzzy Sets • 13 December 2024 • Banska Bystrica, Slovakia/ online (hybrid mode).
Deadline for submissions: 16 November 2024.

Algorithm for transition functioning: Difference between revisions

From Ifigenia, the wiki for intuitionistic fuzzy sets and generalized nets
Jump to navigation Jump to search
mNo edit summary
m formatting changes
Line 13: Line 13:
| width="10%" | '''Step A01'''
| width="10%" | '''Step A01'''
| style="padding-bottom:1em" width="90%" |  Sort the input and output places of the transitions by their priorities.  
| style="padding-bottom:1em" width="90%" |  Sort the input and output places of the transitions by their priorities.  
:: ''An important addition to the GN transition description above, which is related to the software implementation of the transition's functioning, is the following. The tokens from a given input place are divided into two groups. The first group contains those tokens that can be transferred to the transition output, while the second group contains the rest tokens. Let both groups be denoted by '''P<sub>1</sub>(l)''' and '''P<sub>2</sub>(l)''', respectively, where '''l''' is the corresponding place.''
:: ''An important addition to the GN transition description above, which is related to the software implementation of the transition's functioning, is the following. The tokens from a given input place are divided into two groups. The first group contains those tokens that can be transferred to the transition output, while the second group contains the rest tokens. Let both groups be denoted by <math>P_1(l)</math> and <math>P_2(l)</math>, respectively, where <math>l</math> is the corresponding place.''
|- valign="top"  
|- valign="top"  
| '''Step A02'''
| '''Step A02'''
| style="padding-bottom:1em" | Sort the tokens from group '''P<sub>1</sub>''' of the input places (following the order from '''Step 1''') by their priorities.  
| style="padding-bottom:1em" | Sort the tokens from group <math>P_1(l)</math> of the input places (following the order from '''Step A01''') by their priorities.  
:: ''Let '''r<sub>i,j</sub>''' denote the predicate [[index matrix]] of the transition. Then, let us make the following assumption:''
:: ''Let ''r<sub>i,j</sub>'' denote the predicate [[index matrix]] of the transition. Then, let us make the following assumption:''
:: [[Image:Algorithm-transition-functioning-R.png|350px]]
:: [[Image:Algorithm-transition-functioning-R.png|350px]]
|- valign="top"
|- valign="top"
| '''Step A03'''
| '''Step A03'''
| style="padding-bottom:1em" | Assign value 0 to all elements of '''R''', for which either  
| style="padding-bottom:1em" | Assign value 0 to all elements of ''R'', for which either  
* the input place which corresponds to the respective predicate is empty (the '''P<sub>1</sub>''' part is empty); or  
* the input place which corresponds to the respective predicate is empty (the <math>P_1(l)</math> part is empty); or  
* the output place which corresponds to the respective predicate is full; or  
* the output place which corresponds to the respective predicate is full; or  
* the current capacity of the arc between the corresponding input and output places is 0.  
* the current capacity of the arc between the corresponding input and output places is 0.  
|- valign="top"
|- valign="top"
| '''Step A04'''
| '''Step A04'''
| style="padding-bottom:1em" | Calculate the values of the other elements of matrix '''r''' and assign the obtained values to the elements of matrix '''R'''.  
| style="padding-bottom:1em" | Calculate the values of the other elements of matrix ''r'' and assign the obtained values to the elements of matrix ''R''.  
|- valign="top"
|- valign="top"
| '''Step A05'''
| '''Step A05'''
Line 35: Line 35:
| style="padding-bottom:1em" | Perform the following sub-steps for each input place by the order of input place priorities:  
| style="padding-bottom:1em" | Perform the following sub-steps for each input place by the order of input place priorities:  
* Select the tokens with the highest priority in this input place;  
* Select the tokens with the highest priority in this input place;  
* Transfer the selected tokens to all output places, for which the corresponding predicate enables this (the tokens go to group '''P<sub>2</sub>''' of the output places).  
* Transfer the selected tokens to all output places, for which the corresponding predicate enables this (the tokens go to group <math>P_2(l)</math> of the output places).  
|- valign="top"
|- valign="top"
| '''Step A07'''
| '''Step A07'''
| style="padding-bottom:1em" | Transfer the tokens with the highest priority, for which all calculated values of the predicates are equal to '''"false"''' to the group '''P<sub>2</sub>''' of the corresponding places. To this group, also transfer all tokens that cannot be transferred to the corresponding output places because these places have already been filled up with tokens from other places with higher priorities.  
| style="padding-bottom:1em" | Transfer the tokens with the highest priority, for which all calculated values of the predicates are equal to "false" to the group <math>P_2(l)</math> of the corresponding places. To this group, also transfer all tokens that cannot be transferred to the corresponding output places because these places have already been filled up with tokens from other places with higher priorities.  
|- valign="top"
|- valign="top"
| '''Step A08'''
| '''Step A08'''
| style="padding-bottom:1em" | Add '''t<sup>0</sup>''' to the current time, i.e., '''<tt>TIME := TIME + t<sup>0</sup></tt>'''
| style="padding-bottom:1em" | Add ''t<sup>0</sup>'' to the current time, i.e., <tt>TIME := TIME + t<sup>0</sup></tt>
|- valign="top"
|- valign="top"
| '''Step A09'''
| '''Step A09'''
| style="padding-bottom:1em" | Check whether the value of the current time is less than '''t<sub>1</sub> + t<sub>2</sub>''' (the time- components of the considered transition).
| style="padding-bottom:1em" | Check whether the value of the current time is less than  
''t<sub>1</sub> + t<sub>2</sub>'' (the time- components of the considered transition).
|- valign="top"
|- valign="top"
| '''Step A10'''
| '''Step A10'''
| style="padding-bottom:1em" | If the answer to the question on '''Step 9''' is ''"yes"'', go to '''Step 2''' (to update the tokens' order in the places).  
| style="padding-bottom:1em" | If the answer to the question on '''Step A09''' is "yes", go to '''Step A02''' (to update the tokens' order in the places).  
|- valign="top"
|- valign="top"
| '''Step A11'''
| '''Step A11'''
| style="padding-bottom:1em" | If the answer to the question on '''Step 9''' is ''"no"'', terminate the current functioning of the transition.  
| style="padding-bottom:1em" | If the answer to the question on '''Step A09''' is "no", terminate the current functioning of the transition.  
|}
|}
   
   
Line 64: Line 65:
|- valign="top"
|- valign="top"
| '''Step A*03'''
| '''Step A*03'''
| style="padding-bottom:1em" | An empty index matrix '''R''', which corresponds to the matrix of the predicates '''r''' of the given transition, is generated. It is initialized with a value "0" (corresponding to value "false") of all of the elements of this new matrix, which:  
| style="padding-bottom:1em" | An empty index matrix ''R'', which corresponds to the matrix of the predicates ''r'' of the given transition, is generated. It is initialized with a value "0" (corresponding to value "false") of all of the elements of this new matrix, which:  
* are placed in a row, corresponding to an empty input place,  
* are placed in a row, corresponding to an empty input place,  
* are placed in a column, corresponding to a full output place,  
* are placed in a column, corresponding to a full output place,  
Line 70: Line 71:
|- valign="top"
|- valign="top"
| '''Step A*04'''
| '''Step A*04'''
| style="padding-bottom:1em" | The sorted places are passed sequentially by their priority, starting with the place having the highest priority, which has at least one token and through which no transfer has occurred on the current time-step. For its highest priority token (from the first list) the predicates corresponding to the relevant row of matrix '''R''' are checked. The elements of '''r''', for which the elements of '''R''' are not zeros, are calculated.  
| style="padding-bottom:1em" | The sorted places are passed sequentially by their priority, starting with the place having the highest priority, which has at least one token and through which no transfer has occurred on the current time-step. For its highest priority token (from the first list) the predicates corresponding to the relevant row of matrix ''R'' are checked. The elements of ''r'', for which the elements of ''R'' are not zeros, are calculated.  
|- valign="top"
|- valign="top"
| '''Step A*05'''
| '''Step A*05'''
| style="padding-bottom:1em" | Depending on the execution of the operator for permission or prohibition of tokens splitting over the net, the token from '''Step 4*''' will pass either to all permitted to it output places, or to this very place among them, which has the highest priority. If one token cannot pass through a given transition on this time interval, it is moved to the second list of tokens of the corresponding place. The tokens, which have entered the place after the transition activation, are moved to the second list, too.  
| style="padding-bottom:1em" | Depending on the execution of the operator for permission or prohibition of tokens splitting over the net, the token from '''Step A*04''' will pass either to all permitted to it output places, or to this very place among them, which has the highest priority. If one token cannot pass through a given transition on this time interval, it is moved to the second list of tokens of the corresponding place. The tokens, which have entered the place after the transition activation, are moved to the second list, too.  
|- valign="top"
|- valign="top"
| '''Step A*06'''
| '''Step A*06'''
Line 79: Line 80:
|- valign="top"
|- valign="top"
| '''Step A*07'''
| '''Step A*07'''
| style="padding-bottom:1em" | The capacities of all output places, in which a token, determined at '''Step 4*''', has entered, decrement with 1. If the maximum number of tokens for a given output place has been reached, the elements of the corresponding column of matrix '''R''' are set to value "0".  
| style="padding-bottom:1em" | The capacities of all output places, in which a token, determined at '''Step A*04''', has entered, decrement with 1. If the maximum number of tokens for a given output place has been reached, the elements of the corresponding column of matrix ''R'' are set to value "0".  
|- valign="top"
|- valign="top"
| '''Step A*08'''
| '''Step A*08'''
| style="padding-bottom:1em" | The capacities of all arcs, through which a token has passed, decrement with 1. If the capacity of an arc has reached 0, the elements of the corresponding output place of matrix '''R''' are set to value 0.  
| style="padding-bottom:1em" | The capacities of all arcs, through which a token has passed, decrement with 1. If the capacity of an arc has reached 0, the elements of the corresponding output place of matrix ''R'' are set to value 0.  
|- valign="top"
|- valign="top"
| '''Step A*09'''
| '''Step A*09'''
| style="padding-bottom:1em" | The values of the characteristic function '''Φ''' for the output places, in which tokens have entered (formed by the token passed according to '''Step 5*''') are calculated.  
| style="padding-bottom:1em" | The values of the characteristic function ''Φ'' for the output places, in which tokens have entered (formed by the token passed according to '''Step A*05''') are calculated.  
|- valign="top"
|- valign="top"
| '''Step A*10'''
| '''Step A*10'''
| style="padding-bottom:1em" | If there are more places, which could be output ones for tokens at this step, the algorithm returns back to '''Step 4*'''; in the opposite case it proceeds to '''Step 11*'''.
| style="padding-bottom:1em" | If there are more places, which could be output ones for tokens at this step, the algorithm returns back to '''Step A*04'''; in the opposite case it proceeds to '''Step A*11'''.
|- valign="top"
|- valign="top"
| '''Step A*11'''
| '''Step A*11'''
| style="padding-bottom:1em" | The current model time '''t''' is increased with '''t<sup>0</sup>'''.
| style="padding-bottom:1em" | The current model time ''t'' is increased with ''t<sup>0</sup>''.
|- valign="top"
|- valign="top"
| '''Step A*12'''
| '''Step A*12'''
| style="padding-bottom:1em" | Is the current time moment equal to or greater than '''t<sub>1</sub> + t<sub>2</sub>'''?  
| style="padding-bottom:1em" | Is the current time moment equal to or greater than ''t<sub>1</sub> + t<sub>2</sub>''?  
* If the answer of the question is ''"no"'', return to '''Step 4*'''.
* If the answer of the question is "no", return to '''Step A*04'''.
* Otherwise, the transition functioning terminates.  
* Otherwise, the transition functioning terminates.  
|}
|}

Revision as of 19:47, 22 November 2009

The algorithm for generalized net transition functioning represents the algorithm of tokens transfer from an input place of a generalized net transition to its output place.

The algorithm comprises a "building block" for the entire algorithm for generalized net functioning, since the whole GN comprises of a set of sequentially connected transitions.

The first book where the algorithm was published, was the book "Generalized Nets" from 1991 year [1]. The algorithm was modified in 2007 year [2].

When both algorithms are compared for a given transition, its functioning and the results of the work are equal, yet the difference is that in almost any case the new modified algorithm yields results more quickly than the original one.

Original algorithm, 1991

Step A01 Sort the input and output places of the transitions by their priorities.
An important addition to the GN transition description above, which is related to the software implementation of the transition's functioning, is the following. The tokens from a given input place are divided into two groups. The first group contains those tokens that can be transferred to the transition output, while the second group contains the rest tokens. Let both groups be denoted by [math]\displaystyle{ P_1(l) }[/math] and [math]\displaystyle{ P_2(l) }[/math], respectively, where [math]\displaystyle{ l }[/math] is the corresponding place.
Step A02 Sort the tokens from group [math]\displaystyle{ P_1(l) }[/math] of the input places (following the order from Step A01) by their priorities.
Let ri,j denote the predicate index matrix of the transition. Then, let us make the following assumption:
Step A03 Assign value 0 to all elements of R, for which either
  • the input place which corresponds to the respective predicate is empty (the [math]\displaystyle{ P_1(l) }[/math] part is empty); or
  • the output place which corresponds to the respective predicate is full; or
  • the current capacity of the arc between the corresponding input and output places is 0.
Step A04 Calculate the values of the other elements of matrix r and assign the obtained values to the elements of matrix R.
Step A05 Calculate the values of the characteristic functions related to the corresponding output places in which tokens will enter. Assign these characteristics to the entering tokens.
Step A06 Perform the following sub-steps for each input place by the order of input place priorities:
  • Select the tokens with the highest priority in this input place;
  • Transfer the selected tokens to all output places, for which the corresponding predicate enables this (the tokens go to group [math]\displaystyle{ P_2(l) }[/math] of the output places).
Step A07 Transfer the tokens with the highest priority, for which all calculated values of the predicates are equal to "false" to the group [math]\displaystyle{ P_2(l) }[/math] of the corresponding places. To this group, also transfer all tokens that cannot be transferred to the corresponding output places because these places have already been filled up with tokens from other places with higher priorities.
Step A08 Add t0 to the current time, i.e., TIME := TIME + t0
Step A09 Check whether the value of the current time is less than

t1 + t2 (the time- components of the considered transition).

Step A10 If the answer to the question on Step A09 is "yes", go to Step A02 (to update the tokens' order in the places).
Step A11 If the answer to the question on Step A09 is "no", terminate the current functioning of the transition.

Modified algorithm, 2007

Step A*01 The input and the output places are arranged by priority.
Step A*02 In each input place two lists are formed: a list of all tokens, arranged by priority, and an empty list.
Step A*03 An empty index matrix R, which corresponds to the matrix of the predicates r of the given transition, is generated. It is initialized with a value "0" (corresponding to value "false") of all of the elements of this new matrix, which:
  • are placed in a row, corresponding to an empty input place,
  • are placed in a column, corresponding to a full output place,
  • are placed in (i,j)-th position, for which mi,j = 0, i.e. the current capacity of the arc between i-th input and j-th output place is zero.
Step A*04 The sorted places are passed sequentially by their priority, starting with the place having the highest priority, which has at least one token and through which no transfer has occurred on the current time-step. For its highest priority token (from the first list) the predicates corresponding to the relevant row of matrix R are checked. The elements of r, for which the elements of R are not zeros, are calculated.
Step A*05 Depending on the execution of the operator for permission or prohibition of tokens splitting over the net, the token from Step A*04 will pass either to all permitted to it output places, or to this very place among them, which has the highest priority. If one token cannot pass through a given transition on this time interval, it is moved to the second list of tokens of the corresponding place. The tokens, which have entered the place after the transition activation, are moved to the second list, too.
Step A*06 The capacities of all places on the output of the transition, which are input places for another currently active transitions, increment with 1 for each token that has left them on this step.
Step A*07 The capacities of all output places, in which a token, determined at Step A*04, has entered, decrement with 1. If the maximum number of tokens for a given output place has been reached, the elements of the corresponding column of matrix R are set to value "0".
Step A*08 The capacities of all arcs, through which a token has passed, decrement with 1. If the capacity of an arc has reached 0, the elements of the corresponding output place of matrix R are set to value 0.
Step A*09 The values of the characteristic function Φ for the output places, in which tokens have entered (formed by the token passed according to Step A*05) are calculated.
Step A*10 If there are more places, which could be output ones for tokens at this step, the algorithm returns back to Step A*04; in the opposite case it proceeds to Step A*11.
Step A*11 The current model time t is increased with t0.
Step A*12 Is the current time moment equal to or greater than t1 + t2?
  • If the answer of the question is "no", return to Step A*04.
  • Otherwise, the transition functioning terminates.

References

  1. Atanassov K., "Generalized Nets", World Scientific, Singapore, 1991, ISBN 978-981-02-0598-0
  2. Atanassov K., Tasseva V., Trifonov T., Modification of the algorithm for token transfer in generalized nets, Cybernetics and Information Technologies, Vol. 7, 2007, Np. 1, 62-66