How
to create new states
There are several ways to
create new states in a workspace. States
can be created via the command
line or using the batch window
. It is possible to create states
that initially have no markings or it is possible to use flags
to indicate that a state has special properties (e.g., initial,
marked).
A state can also be added by right-clicking in the graph, and selecting "Add State"
from the pop-up menu, but note that this method does not allow for flags.
Using the Command Line
There are two ways to create a
state without flags:
- Type state
state_name
into the command line and press <Enter>.
- Type s
state_name
into the command line and press <Enter>.
Both versions of the command achieve the same result. If the state is
created successfully, a circle (or ellipse if automatic state resizing is enabled), with state_name
displayed at its center,
will appear in the workspace. Also, the status bar will be updated with
a message indicating success. By default, the first state you create is
the initial state.
DESUMA accepts most strings as state names; however, state names
containing blanks are not accepted.
Multiple States
Multiple states can be created via the command line or the batch
window. For either case, the syntax is:
- Type multistate
number_of_states
into the command line and press <Enter>.
- Type ms
number_of_states
into the command line and press <Enter>.
The names of the states are automatically assigned based on the
following rules:
- The least number of letters
available from the word 'state', used sequentially, for which any state
does not already have that name.
- The lowest digit available [1,9].
Example: ms 3 will provide the states {s1, s2, s3} if these states do
not already exist.
Flags
It is also possible to create a state and initially assign it some
properties using the flags options. The syntax is as follows:
state
state_name
[flags]
s
state_name
[flags]
- -i
-I
- tags the state as the
initial state (graphically indicated by
displaying the state name in blue)
-
- -m
-M
- gives the state the
marked
property (graphically indicated by a
double circle in the workspace).
Note:
- At any time there may
only
be one initial state. New states
created (or modified) as initial states will take the initial status
from the previous initial state (if one exists).
- It is necessary to
precede
the flags with a dash character (e.g. "-i").
- Flags are not available
for
the multistate command.
Examples:
- state
1 -IM
(will create an
initial state named 1 that is marked).
- s
34 -I
(will create an
initial state named 34).
- multistate 3 (will
create
three states with default names).
- ms 20 (will create
twenty
states with default names).