This might arise for debugging
or other purposes, including the implementation of the modeling tool itself. The
[ExcludeFromState] attribute can be used to annotate fields that should not be part
of state. This attribute may only be applied to fields.
Fields excluded from the set of state variables must have no behavior affect on
the model, or unpredictable results will occur.
namespace MyModelProgram
{
static class Operations
{
[ExcludeFromState]
static int debugCount = 0;
// ...
}
}
A.1.3 Actions
The action vocabulary of the model is given by the [Action] attribute. The [Action]
attribute applies only to methods.
There are three forms:
[Action]
[Action("label")]
[Action(Start="label", Finish="label")]
where label is a string in the form
label :== action-name [ "(" [ arg { "," arg }* ] ")" ]
action-name :== id
arg :== "this" | "result" | " " | id
id :== ( letterOrDigit | ??™@??™) { letterOrDigit | ??™ ??™ }* // lexical
letterOrDigit :== . . . as defined by Char.IsLetterOrDigit method in .NET
The simple form of the [Action] attribute indicates that a default action label
should be used.
Appendices 285
??? If the target method has no outputs (i.e., it has a void return value and does not
have any byref or out parameters), then a single action with the same name and
arguments as the target method is produced. For example,
[Action] static void Foo(int x) { /* .
Pages:
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372