首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
program代做、代写c/c++,Java编程
项目预算:
开发周期:
发布时间:
要求地区:
Methodological instructions
for laboratory work
Modeling colored Petri nets in CPN Tools
Laboratory work No. 1.
Topic: Petri nets. Introduction to CPN Tools
Theoretical information
CPN Tools is a special software tool designed for modelling hierarchical temporary coloured Petri nets. Such networks constitute a universal algorithmic system that makes it possible to describe arbitrary object.
CPN Tools allows you to visualize the model using a Petri net graph and use the CPN ML (Coloured Petri Net Mark-up Language) programming language for a formalized description of the model.
Purpose of CPN Tools:
development of complex objects and modelling of processes in various applied areas, including: modelling of production and business processes;
modelling of control systems for production systems and robots;
specification and verification of protocols, assessment of network capacity and quality of service, design of telecommunication devices and networks.
Main functions of CPN Tools:
creating (editing) models;
analysis of model behaviour using network dynamics simulation
Petrie;
construction and analysis of the state space of the model.
Interface CPN Tools
The remaining version of the program can be downloaded from the site http://cpntools.org/. The site also contains documentation for design and initial applications, which allows you to quickly master the basic principles of creating models in CPN Tools. After launch, the main CPN Tools window will appear (Fig. 1).
Figure 1 - Main window of CPN Tools
The main window consists of two areas: the work area (on the right) and the menu area (on the left), containing the Tool box, Help system and Options settings. In the work area, you can call up both individual toolbars (Fig. 2) and a graphical representation of the model in the form of a Petri net. To open the tool palette, you need to drag it, holding down the left mouse button, from the menu to the work area.
Figure 2 - Toolbars in the CPN Tools workspace
Two functions are available in the interface assigned to the user:
attraction of the created border «Load Net»;
creation of a new network «New Net».
To create a new network (Fig. 3), you need to press the right mouse button in the work area and press the right mouse button in the menu, select the “New net” item and move the mouse cursor to the new one. The work with other menus in the CPN Tools program is organized in a similar manner.
Figure 3 - Create a new model in CPN Tools
After executing the command to create a new model, the program window will take the form that you see in Figure 4. In this case, a new item «New net.cpn» will appear in the menu area, by opening which you can change the model parameters, declare data types and enter new variables. In addition, right-clicking on the «New net.cpn» item will open a context menu in which you can save the network, undo/redo the action, create a new page and close the network.
Figure 4 - Appearance of the CPN Tools program after creating a new model
There are a few more steps you need to take before you begin. Click on the «Tool box» item in the workspace, select «Create» from the drop-down list, click on it with the mouse and, while holding the mouse button, drag it onto the workspace. Do the same with the «Simulation» item. After completing these steps, panels will be added to create a Petri net (Create) and to control the modelling process (Sim), and the user interface of the program will take the form shown in Figure 5.
Figure 5 - Appearance of the CPN Tools program after adding
new control panels
The tools of the Create panel with their detailed descriptions are presented in Table 1.
The tools of the Simulation panel with their detailed descriptions are presented in Table 2. To set the number of modelling steps, you need to right-click on the corresponding tool and select «Set options» in the context menu that appears. For a modelling tool with visualization of intermediate results, in a similar way you can set the time between modelling steps
Table 1
Tools panel Create
Tool image Description of the tool
Creating a transition. To do this, click on the tool and then on the model in those places where you need to create transitions.
Creating a position. To perform this, you need to click on the tool, and then on the model in those places where you need to create positions.
Creating an arc. To do this, click on the tool and then on the model elements that need to be connected. You can only connect a position with a transition. In this case, the arc will be directed from the first selected element to the second.
Creating a vertical line. To do this, click on the tool and then on the model. The vertical and horizontal lines are intended to organize the model. Elements located near the line are attracted to it. Using this tool, you can improve the perception of the model.
Deleting an element. To delete, click on the tool, and then on the model elements that need to be deleted.
Cloning an element. To clone, you need to use the selected tool to click on the element that needs to be cloned. After this, the cursor will change to the selected element. Then, by clicking on the model, we will create a copy of the element each time. Cloned elements are not renamed. You need to do this yourself.
Changing the direction of the arc. To perform this, you need to click on the corresponding arc with the selected tool. The arc can be either one-sided or two-sided. A double-sided arc is used to save model space and is an analogue of two arcs directed in the opposite direction and having the same expressionsя.
Creating a horizontal line. Similar to creating a vertical line.
Table 2
Tools panel Simulation
Tool image Description of the tool
Transferring the model to the initial state. In this case, all transitions are assigned their initial marking. To perform this, you need to click on the model with the selected tool.
Stopping the model execution. To perform this, you need to click on the model with the selected tool.
Performing an active transition with specific markings. This tool is discussed in more detail below.
Performing one modelling step, that is, one transition. To perform this, you need to click on the model with the selected tool. In this case, one of the active transitions will fire. When you click on an active transition, it will be triggered.
Performing a specified number of steps with a certain time interval between them and visually changing the network markings. To perform this, you need to click on the model with the selected tool. The simulation process can be stopped.
Perform a specified number of steps, without showing intermediate markings. To perform this, you need to click on the model with the selected tool.
Checking the selected text for correctness in terms of the syntax of the built-in programming language CPN ML. To execute, you need to use the selected tool to click on the text containing the CPN ML code.
For interaction with model elements and tool palettes, CPN Tools provides a set of context-sensitive menus that appear on the screen when you click the right mouse button. The menu has the shape of a circle with the names of sectors (see Fig. 3). To save the menu on the screen, you should hold down the mouse button while moving the sector to select the required element. In most cases, the elements of the context-sensitive menus duplicate the tools in the palettes.
In CPN Tools, models are called networks (net). Their description is located in the menu under standard elements. Each network in CPN Tools is represented by the following menu fields:
name - the name of the corresponding file with the extension .cpn;
step (step) - the number of steps performed during the simulation;
time (time) - current model time;
options (options) - network options;
history (history) - a list of commands that were executed above network;
declarations (declarations) - descriptions of multiple colours, variables, functions, constants;
pages (page) - names of network pages (working areas of the model).
Context-sensitive menus are used to create new descriptions and new pages. To open an existing network page, you need to drag it from the side menu to the work area.
CPN Tools provides graphical feedback that reflects the current state of the system:
pop-up messages - a rectangle that appears when you hover the mouse over an object and provides context-sensitive information (errors during syntax checking, errors during network modelling, tooltips in palettes, information for the state indicator, the result of using the CPN ML language evaluation tool, the full path to the saved network);
state indicator - shows the current state of the model (green - the action was completed successfully; red - an error occurred while performing the action; purple - a long-term operation is currently in progress);
element highlighting - colour coding to highlight objects with certain properties:
obright red - indicates objects with errors during syntax checking and network modelling;
odark red - indicates repeated names of positions and transitions during syntax checking;
ogreen - indicates allowed transitions during network modelling;
odark blue - indicates the dependency between descriptions and other elements such as positions, transitions and pages;
osea green colour - indicates the object that contains the description;
oorange – indicates that the object’s syntax checking has not yet begun;
oyellow - indicates that the object’s syntax check is currently being performed;
o– pink - indicates which merged positions belong to the merge set;
o– aqua color - indicates port/socket assignments and page/subpage relationships when working with hierarchical networks;
changing shape of the cursor – determines the actions that can be performed.
Model description language
In CPN Tools, each Petri net element has its own attributes, described in the CPN ML language. Using the network element creation tools, you can place the element on the model page. Then the element attributes are added. To do this, click on the appropriate element and use the Tab button on your keyboard to toggle attributes. Pressing the Esc key on the keyboard allows you to leave the selected item; the same result can be obtained by clicking on any other area of the model.
Position attributes (Fig. 6):
colour of chips;
initial marking;
name.
Figure 6 - CPN Tools Item Attributes
The attribute of an arc is the expression expr, which must correspond to the set of colours of the position associated with the arc (Fig. 7). The transition input arc expression is the template for token selection. This pattern is described as a predicate that can be applied in the filter function to the corresponding set of colours. The transition output arc expression is a constructor for creating new tokens. Such a constructor often uses input arc label variables and in simple cases can coincide with one of them.
Figure 7 - Arc Attribute CPN Tools
Transition attributes (Fig. 8):
transition name;
transition trigger condition (a Boolean expression that evaluates to true or false);
delay time (positive integer);
code segment (ML language procedure that is used for more complex processing of input tokens).
Figure 8 - CPN Tools Transition Attributes
Transition delays apply to all transition output tokens.
Laboratory work No. 0. Model
"Feed the Students"
Consider the example of students eating pie for lunch. A hungry student becomes full after eating a pie.
Thus, we have:
two types of chips: “pies” and “students”;
three positions: “hungry student”, “food”, “satisfied student”;
one transition: “eat”.
1. Draw a network graph. To do this, use the context menu to create a new network, add positions, transition and arcs (Fig. 9).
Figure 9 - Network graph of the “Feed the students” model
2. In the menu, set new model declarations: types of tokens, initial values of positions, expressions for arcs. To do this, hover the mouse over the Standard declarations menu, right-click to open the context menu and select New Decl.
After this, we assign type s to chips related to students, type p to chips related to pies, set the values of the variables x and y for the arcs and the initial values of the multisets init_stud and init_food (Fig. 10):
colset s=unit with student;
colset p=unit with pasty;
var x:s; var y:p;
val init_stud = 3`student;
val init_food = 5`pasty;
As a result, we get a working model (Fig. 11).
Figure 10 - Declarations of the “Feed the Students” model
Figure 11 - Model “Feed the Students”
After launching, chips of the “pies” type from the “food” position and chips of the “students” type from the “hungry student” position, having passed through the “eat” transition, end up in the “well-fed student” position and are transformed into the “students” type (Fig. 12).
Figure 9 - Launch of the “Feed the Students” model
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!