|
|
### The required model file
|
|
|
## The required model file
|
|
|
|
|
|
The model to be read into the program has to be an XML file which fulfils the requirements of the XMLSchema definition.
|
|
|
The model to be read into the program has to be an XML file which fulfils the requirements of the XMLSchema definition [HPnG.xsd](https://github.com/jannikhuels/libhpng/blob/master/xmlschema/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.
|
|
|
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. The upper boundary can also be infinity by setting the value to "infinity" or "inf". 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 (except of the infinity case).
|
|
|
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).
|
|
|
|
|
|
### 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) and "priority" (Integer) for resolving conflicts. In addition deterministic transitions need the attribute "discTime" as Double compatible value for their time to fire after enabling.
|
|
|
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) and dynamic continuous transitions need the sub elements <pid> with the attribute "coef" (for weighting) and containing the id of the referenced continuous transition.
|
|
|
Continuous transitions should have a "rate" attribute (Double >= 0.0) and dynamic continuous transitions need the sub elements <pid> with the attribute "coef" (for weighting) and containing the id of the referenced continuous transition.
|
|
|
|
|
|
### Arcs
|
|
|
|
|
|
The <arcs> section can contain the elements <discreteArc>, <continuousArc> and <guardArc>. All arcs have the attributes "id" and "weight" (as defined above) and "fromNode" and "toNode" for referencing the id of the connected place and transition.
|
|
|
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) and "priority" (Integer). Guard arcs can be test or inhibitor arcs and accordingly have a Boolean flag attribute "isInhibitor". |
|
|
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". |