Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Both sides next revision | ||
alvis:codestructure [2015/11/24 13:04] marcin | — (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Code layer structure ====== | ||
- | The code layer is used to describe the behaviour of individual agents in Alvis models. The layer uses Alvis behaviour description statements and some elements of the Haskell functional programming language. | ||
- | |||
- | |||
- | The code layer must contain at least one **agent block** as shown in Listing 1. It is possible to share one definition among a few agents. In such a case, a few agents' | ||
- | |||
- | < | ||
- | agent AgentName | ||
- | { | ||
- | -- declaration of parameters | ||
- | -- agent body | ||
- | } | ||
- | </ | ||
- | |||
- | **Listing 1. ** Structure of an agent block | ||
- | |||
- | Both Haskell and Alvis are case sensitive languages. Haskell requires type names to start with an upper-case letter, and variable names to start with a lower-case letter. We follow Haskell footsteps. Moreover, Alvis requires agent names to start with an upper-case letter, and port names to start with a lower-case letter. | ||
- | |||
- | |||
- | **[[: |