Hello World
Simple Non-sensical Demonstration Examples


Purpose of this Example

The Model

This small example models a hotel; you start outside, you get to the door and is greeted by a doorman, and finally you enter the lounge.

hello_world_screenshot.gif

Declarations

The declarations set up the connection to BRITNeY. Everything happens in the "Animation setup" declaration group:

hello_world_declarations.gif

In this example, we assume that BRITNeY is running on the same machine as CPN Tools. You can take a look at all the 6 generated functors if you need to run BRITNeY on another computer that CPN Tools..

We just create two new objects in BRITNeY, dialog and msg. Each object is created by a Standard ML functor, which takes as parameter a descriptive name of the new object.

Action Parts

The real communication with BRITNeY happens in the action parts of the transitions Get Name and Say Hello (see the screenshot above).

The available actions for each object can be seen by evaluating open <object-name>, e.g.:
hello_world_interface.gif

The Get Name transition asks the user for his/her name using the dialog object. The Say Hello displays a dialog on the users screen with the text Hello <name>.

Simulation

hello_world_dialog1.gif hello_world_model1.gif hello_world_dialog2.gif hello_world_model2.gif

Download

Next Step

For a more comprehensive example, you should now take a look at the Simple Protocol. Or you can skip it and go to drawing either the state-space for Dining Philosophers or Message Sequence Charts.

Version 26, Wed 12 Jul 2006 14:12:00 [tveon] - created Fri 09 Jul 2004 13:56:03 [mw]