hewlett-packard UNITED STATES
Skip site-wide navigation link group hewlett-packard home products and services support solutions how to buy
End of site-wide navigation link group
hewlett-packard logo - invent - jump to hp.com home page
DEMOS 2000 skip lorem ipsum dolor navigation menu link group
search
contact hp
Syntax
Semantics
Examples
Full Guide
Download
Online Help
FAQ
Changes
end of lorem ipsum dolor navigation menu link group
 DEMOS programs are written in a process oriented discrete event style. 

Consider the classic first example:

A port has 2 jetties each of which can be used for unloading by one boat at a time. Boats arrive at the port periodically and must wait if no jetty is currently free. When a jetty is available, a boat may dock and start to unload. When this activity has been completed, the boat leaves the jetty and sails away. The port authority has a pool of 3 tugs. Two are required for docking: only one when a boat leaves its jetty.

This model would be written in Demos as follows:

class boat=
     {getR(jetties,1); 
        getR(tugs,2);
         hold(2.0);
        putR(tugs,2);

        hold(14.0);

        getR(tugs,1);
         hold(2.0);
        putR(tugs,1); 
      putR(jetties,1);
     }      (***boat***)

    Res(tugs, 3);
    Res(jetties, 2);
    Entity(boat,boat,0.0);
    Entity(boat,boat,1.0);
    Entity(boat,boat,15.0);

    hold(36.0);
    Close;
    

 

 

Skip print link group follow this link for information about printing this page
printing instructions
End of print link group
privacy statement Using this site means you accept its Terms © 1994-2002 hewlett-packard company