Skip to content

The required model file

Carina Pilch edited this page Aug 2, 2018 · 14 revisions

The model to be read into the program has to be an XML file which fulfils the requirements of the XMLSchema definition HPnG.xsd. Additional to this schema, you can find a rough overview here. (A general knowledge of hybrid petri nets is required.)

The root XML element has to be <HPnG>. Within this root there can and should be the 3 kinds of model objects <places>, <transitions> and <arcs>.

Places

Within the <places> section there can be an arbitrary number of <discretePlace> and <continuousPlace> elements. Both should contain the unique attribute "id".

Discrete places should also contain the attribute "marking" which implies the number of tokens of this place in the initial state and its value has to be convertible to an Integer value (>= 0).

Continuous places should have the attribute "capacity" for the place's maximum fluid capacity and the Boolean flag attribute "infiniteCapacity" set to "1" if the place has no upper boundary. The lower boundary for a place is always zero. Continuous places also need the attribute "level" for the fluid level of the place in the initial state. Both values, for capacity and level, have the be convertible to Double values (>= 0.0).

If you use the current version 2.0, continuous places can have non-linear continuous behavior, which is approximated by piecewise-linear trajectories. In this case, you need also a attribute "quantum", which determines much far the approximated value is allowed to differ from the real value.

Transitions

Within the <transitions> section there can be 5 kinds of transitions: <immediateTransition>, <deterministicTransition>, <generalTransition>, <continuousTransition> and <dynamicContinuousTransition>. Transitions should also contain an "id" attribute.

Immediate, deterministic and general transitions have the attributes "weight" (Double > 0.0) and "priority" (Integer >= 0) for resolving conflicts. In addition deterministic transitions need the attribute "discTime" as Double (> 0.0) compatible value for their time to fire after enabling.

General transitions also need the attribute "policy" which can have one of the values "resume", "repeatdifferent" or "repeatidentical", defining what happens to the enabling time when a general transition is disabled and enabled again. Furthermore the attribute "cdf" defines the cumulative distribution function for the firing of the transition and depending on this attribute different sub XML elements of the type <parameter> are needed with the attributes "name" and "value". See the list for all parameters needed.

Continuous transitions should have a "rate" attribute (Double >= 0.0).

In version 1.0, dynamic continuous transitions need the sub elements <pid> with the attribute "coef" (for weighting) and containing the id of the referenced continuous transition. From version 2.0, those sub elements are optional for dynamic continuous transitions and they additionally may have the attributes "rateFunction" and "changeOfRateFunction" to define a textual description of the rate function and its first derivative.

Arcs

The <arcs> section can contain the elements <discreteArc>, <continuousArc> and <guardArc>. All arcs have the attributes "id" and "weight" (as defined above for transitions) and "fromNode" and "toNode" for referencing the id of the connected place and transition.

In addition continuous arcs should have the attributes "share" (Double > 0.0) and "priority" (as defined above for transitions). Guard arcs can be test or inhibitor arcs and accordingly have a Boolean flag attribute "isInhibitor".