archive-org.com » ORG » C » CPNTOOLS.ORG

Total: 415

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Uniform << CPN Tools Homepage
    this page from your book Show modify book 28 page s Help Uniform Interface uniform a real b real real where a b Returns a drawing from a continuous uniform distribution between a and b Raises Uniform exception if a b Characteristics Mean a b 2 Variance b a 2 12 Density functions for continuous uniform distributions Example uniform 1 0 10 0 A person is asked to choose a

    Original URL path: http://cpntools.org/documentation/tasks/performance/random/uniform (2016-04-26)
    Open archived version from archive


  • Model parameters << CPN Tools Homepage
    example net the color of the token on place SP determines the probability that a packet will be transmitted successfully The color of this token is determined by the initial marking inscription of the place and the color of the token is never changed by the occurrence of the Transmit Packet transition Parameters can also be defined as reference variables in globref declarations The following example shows how the OK function from the Timed protocol example can be rewritten to use a reference variable rather than the value of a token on a place to determine the probability for successful transmission The declarations for variable s and function OK must be changed to globref s 8 Ten0 fun OK r Ten1 r s The variable s has been changed to a reference variable Its initial contents is the value 8 from the color set Ten0 The OK function has been changed to take one argument instead of two In the body of the function the argument r is compared to the contents of s which is obtained using the operator Given these declarations the inscription on the output arc from the Transmit Packet transition must be changed and place SP can be removed Changing parameter values All parameter values can of course be changed If a parameter is defined as a constant in a net inscription as a constant token color or in a declaration of a constant a val declaration a color set or a function then the only way to change the value of the parameter is to manually edit the appropriate declaration or net inscription When such a change is made CPN Tools will automatically recheck the syntax for the parts of the model that are dependent on the declaration or inscription If a parameter is defined as a reference variable then the value of the parameter can be changed without having to manually edit the declaration and it is not necessary to recheck the syntax of any parts of the model One way to change the contents of a reference variable is to apply the Evaluate ML tool to an auxiliary text containing an appropriate CPN ML expression Here for example is a CPN ML expression that will change the contents of reference variable s to the value 6 Reference variables in initial marking inscriptions Note that initial marking inscriptions should not depend on reference variables This is due to the fact that the initial marking of a place is calculated once immediately after a syntax check of the place Suppose that an initial marking inscription did depend on a reference variable Suppose also that the contents of the reference variable is changed after the syntax of the place has been checked If model is returned to the initial marking e g if the Rewind tool is applied then the initial marking of the place will not be recalculated and the initial marking of the place will not depend on the new value of the reference

    Original URL path: http://cpntools.org/documentation/concepts/colors/declarations/model_parameters (2016-04-26)
    Open archived version from archive

  • Time attributes in tokens << CPN Tools Homepage
    is accurately represented as a string 1165 and as an integer 1165 in the token value The object arrived at time 596 The object has waited 45 units of time before being processed by a resource in task 1 The processing time for the object in task 1 was 524 units of time Arrivals page The Arrivals page must be changed so that the time attributes are properly initialized when a token representing a new object is created When the Arrivals transition occurs the newX function is used to create a token that represents a new object This is the declaration of the function fun newX X ran ModelTime toString time intTime intTime 0 0 When called the newX function returns a value from the XT color set i e it will return a 6 tuple as described above The first component is the kind of the object and it is again chosen randomly using the X ran function The second and third components should be string and integer representations of the time stamp of the token that is added to place New Arrivals Since there is neither a time inscription on the transition nor an arc delay on the arc from transition Arrivals to place New Arrivals the time stamp of the token added to New Arrivals will be equal to the model time at which Arrivals occurs When the expression ModelTime toString time is evaluated it will return the string representation of the current model time The ModelTime toString function is one of the Simulator functions The fourth component represents the arrival time of the object Since the arrival time of the object is equal to the model time at which Arrivals occurs the intTime function is also used to obtain the arrival time of the object The fifth and sixth components represent the total wait and processing times respectively for the object These values are initialized to 0 In the figure above Arrivals is enabled Since the time stamp of the token on place Next is 1777 the current model time must be 1777 When the transition occurs the newX function will be called and a new token will be added to place New Arrivals The value of the token that is added can be seen in the figure below showing the Process page Process page Few changes need to be made in the Process page with respect to the first example Only the color sets for places New Arrivals Wait and Completed have been changed from X to XT Task page In the Task page several inscriptions need to be changed in order to properly handle the new token values that contain time attributes The color sets for places Wait for Resource Processing and Output have been changed from X to XT When transition Start occurs one token representing an object will be removed from Wait for Resource and a token representing the same object will be added to Processing Several of the time attributes that are associated with the object need to be updated when this token is moved The startProc function which is called in the code segment for Start is used to update the appropriate time attributes for the object This function is not used anywhere else in the model The startProc function is defined as follows fun startProc x tss tsi at wt pt XT let val proc time expTime avg proc time val time stamp ModelTime add time ModelTime fromInt proc time val new tss ModelTime toString time stamp val new tsi IntInf toInt time stamp val new wt wt intTime tsi val new pt pt proc time in x new tss new tsi at new wt new pt proc time end The function takes an XT value as an argument and the argument represents an object that a resource is starting to process The object is represented by a token that is removed from place Waiting for Resource The parameters x tss tsi at wt and pt of the function represent the kind of the object string and integer representations of a time stamp the arrival time of the object and the total waiting and processing times for the object respectively When the Start transition occurs it represents the start of the time during which an object will be processed by a resource Because it takes time to process an object a time delay will be added to the token that is added to place Processing In the startProc function the local value proc time is the processing time that is generated for the object The processing time is obtained by calling the expTime function just as in the first example The value proc time will be used to calculate the time stamp for the token When the Start transition occurs the time stamp for the token that is added to place Processing will be equal to the model time at which the transition occurs the value of proc time as determined by the occurrence rule for timed CPNs Since the time stamp for the token to be added to Processing will be different from current model time the string and integer representations of the token s time stamp must be updated accordingly The local value time stamp will have the same value as the time stamp of the token added to Processing The local values new tss and new tsi are the string and integer representations of the value of time stamp The token that is removed from place Waiting for Resource represents an object that has been waiting for a resource This means that the time attribute that represents the total waiting time for the object must be updated The new total wait time is equal to the old total wait time plus the amount of time the token representing the object was on place Waiting for Resource Whenever a token is added to place Waiting for Resource the time stamp of the token is equal to the

    Original URL path: http://cpntools.org/documentation/concepts/time/time_attributes_in_tokens (2016-04-26)
    Open archived version from archive

  • Performance analysis << CPN Tools Homepage
    cases it is insufficient to model the average amount of time that a certain activity takes it is necessary to include a more precise representation of the timing of the system The Random distribution functions can be used to precisely model time delays Consider a system in which new items arrive in the system with exponentially distributed inter arrival times Below is an example of a function in which the Exponential function is used to create inter arrival times that are approximately exponentially distributed The inter arrival times are only approximately exponentially distributed because the real values that are returned by the Exponential function must be converted to integers since all time delays must be integer values Time delay inscriptions can be added as Arc inscriptions and Transition inscriptions fun expTime mean int let val realMean Real fromInt mean val rv exponential 1 0 realMean in floor rv 0 5 end This function can then be used when modeling the arrival of new items to a system A new item is created i e it arrives in the system when the transition Arrive occurs The time stamp for the token on place Next determines when the Arrive transition will be enabled and the expTime function is used to ensure that the inter arrival times of new items are approximately exponentially distributed Workload When analysing the performance of a system one is often interested in measuring the performance of system when it processes a particular kind of workload For example the workload for the Simple protocol example is data packets and when studying a bank the workload could be customers With CPNs it is possible to use both fixed workloads i e workloads that are predetermined at the start of a simulation and dynamic workloads In the example net for the Simple protocol example the workload is fixed and it is determined by the initial marking for the place Send It is also possible to generate workload on the fly during a simulation In the example below the workload is jobs The timed token on the place Next determines that a new job will be created periodically and the inter arrival times of jobs is exponentially distributed with a mean of 100 as described above Kinds of simulations Statistical techniques exist for using simulation models to analyze terminating and non terminating systems Terminating simulations Terminating systems are characterized by having a fixed starting condition and a naturally occurring event that marks the end of the system An example of a terminating system is a work day that starts at 8 am and ends at 4 pm at a bank For terminating systems the initial conditions of the system generally affect the desired measures of performance The purpose of simulating terminating systems is to understand their behavior during a certain period of time and this is also referred to as studying the transient behavior of the system Terminating simulations are used to simulate terminating systems The length of a terminating simulation is

    Original URL path: http://cpntools.org/documentation/tasks/performance/start?do=addtobook (2016-04-26)
    Open archived version from archive

  • Performance analysis << CPN Tools Homepage
    start or end of a simulation Timed CP nets In many cases concepts time start timed CPNs will be used for performance analysis A timed CPN can model how much time certain activities require and how much time passes between other activities In most cases it is insufficient to model the average amount of time that a certain activity takes it is necessary to include a more precise representation of the timing of the system The random start can be used to precisely model time delays Consider a system in which new items arrive in the system with exponentially distributed inter arrival times Below is an example of a function in which the random exponential function is used to create inter arrival times that are approximately exponentially distributed The inter arrival times are only approximately exponentially distributed because the real values that are returned by the random exponential function must be converted to integers since all time delays must be integer values Time delay inscriptions can be added as concepts colors inscriptions arc inscriptions and concepts colors inscriptions transition inscriptions code fun expTime mean int let val realMean Real fromInt mean val rv exponential 1 0 realMean in floor rv 0 5 end code This function can then be used when modeling the arrival of new items to a system A new item is created i e it arrives in the system when the transition Arrive occurs The time stamp for the token on place Next determines when the Arrive transition will be enabled and the expTime function is used to ensure that the inter arrival times of new items are approximately exponentially distributed documentation dynamicworkload jpg Exponentially distributed inter arrival times Workload When analysing the performance of a system one is often interested in measuring the performance of system when it processes a particular kind of workload For example the workload for the examples Simple Protocol is data packets and when studying a bank the workload could be customers With CPNs it is possible to use both fixed workloads i e workloads that are predetermined at the start of a simulation and dynamic workloads In the example net for the examples Simple Protocol the workload is fixed and it is determined by the initial marking for the place Send documentation fixedworkload jpg Fixed workload It is also possible to generate workload on the fly during a simulation In the example below the workload is jobs The timed token on the place Next determines that a new job will be created periodically and the inter arrival times of jobs is exponentially distributed with a mean of 100 as described above documentation dynamicworkload jpg Dynamic workload Kinds of simulations Statistical techniques exist for using simulation models to analyze terminating and non terminating systems Terminating simulations Terminating systems are characterized by having a fixed starting condition and a naturally occurring event that marks the end of the system An example of a terminating system is a work day that starts at 8

    Original URL path: http://cpntools.org/documentation/tasks/performance/start?do=edit&rev= (2016-04-26)
    Open archived version from archive

  • Multisets << CPN Tools Homepage
    then the empty multiset will be returned Example The multiset operator combined with multiset addition and subtraction described below provide a succinct method for specifying multisets For example 3 true 2 false is a Boolean multiset consisting of 5 Boolean values 3 instances of true and 2 instances of false Constants operations and functions empty the empty constant constructs an empty multiset that is identical for all kinds of multisets ms1 ms2 multiset equality ms1 ms2 multiset inequality ms1 ms2 multiset greater than ms1 ms2 multiset greater than or equal to ms1 ms2 multiset less than ms1 ms2 multiset less than or equal to ms1 ms2 multiset addition ms1 ms2 multiset subtraction ms2 must be less than or equal to ms1 raises Subtract exception if ms2 is not less than or equal to ms1 i ms scalar multiplication size ms size of multiset ms random ms returns a pseudo random color from ms cf c ms returns the number of appearances of color c in ms filter p ms takes a predicate p and a multiset ms and produces the multiset of all the appearances in ms satisfying the predicate ext col f ms takes a function f and a

    Original URL path: http://cpntools.org/documentation/concepts/colors/multi-sets (2016-04-26)
    Open archived version from archive

  • Animations and vizualisation with BRITNeY Suite << CPN Tools Homepage
    creator Add this page to your book Book creator Remove this page from your book Show modify book 29 page s Help Animations and vizualisation with BRITNeY Suite BRITNeY Suite consists of a Java application and a CPN ML library which among other things enables vizualisation and advanced interaction through CPN Tools We no longer recommend using BRITNeY for new projects but instead to take a look at Access CPN

    Original URL path: http://cpntools.org/documentation/concepts/external/animations_and_visualisat (2016-04-26)
    Open archived version from archive

  • Connection management functions << CPN Tools Homepage
    DupConnNameExn exception is raised if this is not the case The function then attempts to create a connection to the external process If successful the appropriate information is stored and added to the list of connections The return type of this function is type unit ConnManagementLayer acceptConnection string int unit Provides server behavior and allows external processes to connect to CPN Tools The first argument must be a unique string identifier to be associated with the connection The second argument is a port number The function checks that the string identifier is unique and then listens on the given port for incoming connection requests This causes CPN Tools to block until an incoming connection request is received When this happens a connection is established with the external process requesting the connection ConnManagementLayer send string a a Word8Vector vector unit Allows users to send any type of data to external processes The function is polymorphic in the sense that the data passed to it for sending can be of any type including user defined types Three parameters are passed to this function as input The first is a string identifier for the connection the second is the data to send and the third is a function to encode the data to send The purpose of the encoding function is to encode the data to send into a sequence of bytes This allows the data to be of any type provided an encoding function exists for that type The send function retrieves the connection corresponding to the given string identifier The return type of this function is type unit ConnManagementLayer receive string Word8Vector vector a a Allows users to receive any type of data from an external process The receive function is polymorphic in the same way as the ConnManagementLayer send function

    Original URL path: http://cpntools.org/documentation/concepts/external/commscpn_functions (2016-04-26)
    Open archived version from archive



  •