From: schristensen@daimi.aau.dk (Soren Christensen) To: designcpn@daimi.aau.dk Date: Wed, 17 Jul 1996 12:55:41 +0200 Subject: Re: Plotting place usage? > I hope this is not a trivial question. I would like to run a simulation > and plot the occupancy of a place. (The place simulates a queue in an > asynchronous processor. The number of tokens indicates the number of > instructions waiting in the queue.) I would like to plot the number of > tokens resident in the queue over time. > > Is there a standard function for this? If not, how do you suggest I > go about it? I have created a small example which shows how it can be done, the example can be found as: http://www.daimi.aau.dk/designCPN/email/p/models/post960717a.tar.Z We can split the problem into two independent parts. 1) How do I get the number of tokens on a place? 2) How do I plot values as a function of time? ad 1) There is no way to directly access the marking of a place, so you need to collect this information yourself. In the example I have chosen to collect the information in a global reference, called Cnt, which is incremented by a code segment by all transitions adding tokens to the place, and likewise decremented by transitions removing tokens. ad 2) In the example I use a Line Chart with time on the x-axes and number of tokens on the y-axes. The update interval is set to be each time tick. The additional global reference called OldCnt is used to avoid unnecessary updates of the chart. Hope the example can be used as an inspiration to solve your problem. Best regards, Soren Christensen --------------------------------------------------------------------- | Soren Christensen, Computer Science Department, Aarhus University | | Ny Munkegade 116, DK-8000 Aarhus C, DENMARK | | email: schristensen@daimi.aau.dk | phone: +45 89 42 32 65 | | telefax: +45 89 42 32 55 | phone at home: +45 86 93 63 26 | | WWW URL: | --------------------------------------------------------------------- --- [[ Post messages and summary of replies: designCPN@daimi.aau.dk ]] [[ To (un)subscribe, send "help" to: Majordomo@daimi.aau.dk ]] [[ The moderator's address: designCPN-owner@daimi.aau.dk ]] [[ World Wide Web URL: http://www.daimi.aau.dk/designCPN/email/ ]]