Submit your research to the International Journal "Notes on Intuitionistic Fuzzy Sets". Contact us at nifs.journal@gmail.com

Call for Papers for the 27th International Conference on Intuitionistic Fuzzy Sets is now open!
Conference: 5–6 July 2024, Burgas, Bulgaria • EXTENDED DEADLINE for submissions: 15 APRIL 2024.

GNTicker: Difference between revisions

From Ifigenia, the wiki for intuitionistic fuzzy sets and generalized nets
Jump to navigation Jump to search
(- moved to GN XML format)
Line 2: Line 2:
'''GNTicker''' is an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter] for a certain kind of [[reduced generalized nets|reduced]] [[generalized nets]] (GN). It can be run as a standalone program or as a server, which allows simultaneous execution of multiple GN models. The software application is written in C++ for CLBME by [[Kalin Georgiev]] and [[Trifon Trifonov]].  
'''GNTicker''' is an [http://en.wikipedia.org/wiki/Interpreter_(computing) interpreter] for a certain kind of [[reduced generalized nets|reduced]] [[generalized nets]] (GN). It can be run as a standalone program or as a server, which allows simultaneous execution of multiple GN models. The software application is written in C++ for CLBME by [[Kalin Georgiev]] and [[Trifon Trifonov]].  


Generalized net models are described (or coded, programmed) on two levels. First of all, the structure of the model is defined in an XML file. This definition includes description of the GN’s [[transition]]s, [[place]]s, [[token]]s and [[index matrix|matrices]]. Each GN component is given a unique name (identifier) and the structure of the XML definition allows the interpreter to extract information about the relations between those components. In the place definitions and predicate matrix definitions, characteristic functions and predicates are only referred by their names. Their actual definitions come in the second part of the GN code – the [[GNTCFL]] program.
Generalized net models are described (or coded, programmed) on two levels. First of all, the structure of the model is [[GN XML format|defined in an XML file]]. This definition includes description of the GN’s [[transition]]s, [[place]]s, [[token]]s and [[index matrix|matrices]]. Each GN component is given a unique name (identifier) and the structure of the XML definition allows the interpreter to extract information about the relations between those components. In the place definitions and predicate matrix definitions, characteristic functions and predicates are only referred by their names. Their actual definitions come in the second part of the GN code – the [[GNTCFL]] program.


GNTCFL is a language with [http://en.wikipedia.org/wiki/Lisp_(programming_language) Lisp]-like syntax developed especially for GNTicker. A GNTCFL program is a set of function definitions that can be used as characteristic functions and predicates as well as user defined utility functions.
GNTCFL is a language with [http://en.wikipedia.org/wiki/Lisp_(programming_language) Lisp]-like syntax developed especially for GNTicker. A GNTCFL program is a set of function definitions that can be used as characteristic functions and predicates as well as user defined utility functions.


The XML definition of a GN model structure and the GNTCFL program with definitions of characteristic functions and predicates form the complete GN code which can be “executed” by GNTicker. The “execution” process is actually an interpretation of the definitions and a calculation of token characteristic for each step of some GN’s life. GNTCFL provides certain tracing capabilities that allow characteristics of various tokens to be printed to the standard output or sent to another process and eventually recorded to form the “result” of the GN’s execution. The recorded data can be visualized later, or during the GN model execution. The MS Windows version of GNTicker has primitive support for real-time visualization of function graphics.
The [[GN XML format|XML definition of a GN model]] structure and the GNTCFL program with definitions of characteristic functions and predicates form the complete GN code which can be “executed” by GNTicker. The “execution” process is actually an interpretation of the definitions and a calculation of token characteristic for each step of some GN’s life. GNTCFL provides certain tracing capabilities that allow characteristics of various tokens to be printed to the standard output or sent to another process and eventually recorded to form the “result” of the GN’s execution. The recorded data can be visualized later, or during the GN model execution. The MS Windows version of GNTicker has primitive support for real-time visualization of function graphics.


== Basic concept ==
== Basic concept ==
The presented GNTicker is an interpreter for a certain kind of reduced Generalized Nets (GN). It provides capabilities to code a GN by describing its structure and programming its characteristic functions and predicates, execute it and trace the execution.
The presented GNTicker is an interpreter for a certain kind of reduced Generalized Nets (GN). It provides capabilities to code a GN by describing its structure and programming its characteristic functions and predicates, execute it and trace the execution.
=== Running the interpreter ===
=== Running the interpreter ===
This version of GNTicker interpreter is an executable which needs the following files to operate:
This version of GNTicker interpreter is an executable which needs the following files to operate:
* gnticker.exe – the interpreter
* gnticker.exe – the interpreter
* gnschema.xsd – not described here
* [[gnschema.xsd]] – not described here
* xerces-c_2_1_0.dll – Xerces XML interface library
* xerces-c_2_1_0.dll – Xerces XML interface library
In order to run a GN use the following command line syntax:
In order to run a GN use the following command line syntax:
Line 19: Line 20:


=== Programming a GN ===
=== Programming a GN ===
A GN description consists of
A GN description consists of:
* A GN model structure described in an XML file (see section 2);
* A GN model structure described in an XML file;
* Characteristic functions, predicates and user-defined functions coded in the XML definition, or in separate GNTCFL files, referred to in the XML. (see section 3).
* Characteristic functions, predicates and user-defined functions coded in the XML definition, or in separate GNTCFL files, referred to in the XML.  
 
== Detailed view of the XML definition ==
The GN model structure is defined in XML 1.0 syntax. A comprehensive set of XML tag and attribute definitions is shown on the following tree diagram. The tags are displayed in rectangles and the attributes - in ellipses. Required attributes are underlined.
 
=== Description of the XML tags ===
* <gn> - the root tag of the GN definition
* <transitions>, <tokens>, <places> - contain one or more definitions for transitions,
tokens and places, respectively
* <transition>, <token>, <place> - contain a separate definition for each of the
corresponding GN elements
<generator> - a definition of a token generator, extends the <token> tag
* <char> - a named characteristic definition, contains the initial value of the
characteristic. This can be:
** a real constant for type “double”
** a vector constant for type “vector” - a list of constants, enclosed in square brackets (for example: [1 “string” 3.5])
** any other value is treated like a string constant for type “string”
* <functions> - contain inline definitions of GNTCFL functions and empty <import> tags with filenames of files to import
* <inputs>, <outputs> - contain a list of the identifiers of the input and output places
for the transition
* <predicates> - contains a list of the identifiers of predicates, defined in the GNCTFL file. The list describes the predicate matrix of the transition, which is listed row by row, starting with the first. The list must contain exactly m.n identifiers, where m and n are the number of input and output places of the transition. Valid identifiers are also “true” and “false”, which represent the corresponding constant predicates.
 
=== Description of the XML attributes ===
* id – an identifier for the corresponding element. All identifiers must be unique.
* priority – a non-negative integer, stating the priority of the transition, token or place. Default priority is 0.
* gn.name – a description of the GN model
* gn.time – the lifetime of the model on the global time scale. Must be positive.
* import.fundefs – the name of the imported GNTCFL file used for characteristic functions and predicates for this model. A full absoulte or relative path must be specified.
* place.capacity – an integer >= -1, which states the capacity of the place, default is -1 meaning infinity.
* place.char – the identifier of a characteristic function for the place, defined in the GNCTFL file (see Section 3). A valid identifier is also “ID” that represents the identity function, which is also the default characteristic function, if a value for this attribute is not specified.
* place.merge – a boolean value (1,0, true, false), which states whether the tokens in this place merge
* place.mergeRule – the identifier of a characteristic GNTCFL function with a single parameter, which defines the way in which token characteristics merge
* token.host – the identifier of a place, where the token enters the GN
* token.entering – the time moment in which the token enters the GN model, a non-negative integer, default is 0 – the starting moment of the GN life.
* token.leaving – the time moment in which the token should leave the GN model (“die”). An integer >= -1, default is -1, meaning infinity.
* char.name – the name of the named characteristic, must be an identifier
* char.type – describes the type of the token characteristic. Possible values are “double”, “string”, “vector”.
* char.history – an integer >= 1, showing the number of characteristics, which the token keeps as history. The value is 1 by default, stating that the token “remembers” only its last characteristic.
* generator.period – the period of a periodic generator. By default 1 (every step).
* generator.predicate – the activation condition of a conditional generator. By default “true” (every step).
* generator.type – a string, specifying the type of generator:
** periodic – emits a token every period time steps
** conditional – emits a token on each time step, for which predicate evaluates to true
 
=== Example: test.xml ===
<source lang="xml">
        <?xml version=”1.0”?>
        <gn name=”A Test GN” time=”10”>
                <transitions>
                <transition id=”Z1”>
                        <inputs> P1 P2        </inputs>
                        <outputs> P2 </outputs>
                        <predicates>
                                true
                                less_than_10
                        </predicates>
                </transition>
        </transitions>
        <places>
                <place id=”P1”/>
                <place id=”P2” char=”inc”/>
        </places>
        <tokens>
                <token id=”T1” host=”P1”>
                        <char name=”Default” type=”double”> 0 </char>
                </token>
        </tokens>
        <functions>
                (defun inc “” () ()
                        (set (+ token 1)))
                (defun less_than_10 “1;tokens.T1.char” () ()
                        (< #0 10))
        </functions>
        </gn>
</source>


== GNTicker runtime ==
== GNTicker runtime ==

Revision as of 21:56, 27 April 2009

GNTicker is an interpreter for a certain kind of reduced generalized nets (GN). It can be run as a standalone program or as a server, which allows simultaneous execution of multiple GN models. The software application is written in C++ for CLBME by Kalin Georgiev and Trifon Trifonov.

Generalized net models are described (or coded, programmed) on two levels. First of all, the structure of the model is defined in an XML file. This definition includes description of the GN’s transitions, places, tokens and matrices. Each GN component is given a unique name (identifier) and the structure of the XML definition allows the interpreter to extract information about the relations between those components. In the place definitions and predicate matrix definitions, characteristic functions and predicates are only referred by their names. Their actual definitions come in the second part of the GN code – the GNTCFL program.

GNTCFL is a language with Lisp-like syntax developed especially for GNTicker. A GNTCFL program is a set of function definitions that can be used as characteristic functions and predicates as well as user defined utility functions.

The XML definition of a GN model structure and the GNTCFL program with definitions of characteristic functions and predicates form the complete GN code which can be “executed” by GNTicker. The “execution” process is actually an interpretation of the definitions and a calculation of token characteristic for each step of some GN’s life. GNTCFL provides certain tracing capabilities that allow characteristics of various tokens to be printed to the standard output or sent to another process and eventually recorded to form the “result” of the GN’s execution. The recorded data can be visualized later, or during the GN model execution. The MS Windows version of GNTicker has primitive support for real-time visualization of function graphics.

Basic concept

The presented GNTicker is an interpreter for a certain kind of reduced Generalized Nets (GN). It provides capabilities to code a GN by describing its structure and programming its characteristic functions and predicates, execute it and trace the execution.

Running the interpreter

This version of GNTicker interpreter is an executable which needs the following files to operate:

  • gnticker.exe – the interpreter
  • gnschema.xsd – not described here
  • xerces-c_2_1_0.dll – Xerces XML interface library

In order to run a GN use the following command line syntax:

gnticker <GN description file> <steps>

Programming a GN

A GN description consists of:

  • A GN model structure described in an XML file;
  • Characteristic functions, predicates and user-defined functions coded in the XML definition, or in separate GNTCFL files, referred to in the XML.

GNTicker runtime

GN time moments

GNTicker tracing capabilities

See also

References