Table of Contents
An agent script is a script stored in a file named *.agent which can include the other agent scripts.
The agent script system is under-construction; which will be updated frequently.
In the following guide, a CAPITAL WORD denotes a parameter, and the others are keywords.
Characters followed by "//" are parsed as a comment.
// THIS IS A COMMENT module MAVFTable avf_table // THIS IS A COMMENT
In order to instantiate a module, write as follows:
module MODULE_TYPE INSTANCE_NAME
In order to connect two ports, write as follows:
connect FROM_MODULE.FROM_PORT , TO_MODULE.TO_PORT
A module can be removed as follows:
remove INSTANCE_NAME
In order to disconnect the ports, write as follows:
disconnect FROM_MODULE.FROM_PORT , TO_MODULE.TO_PORT
In order to assign into parameters in a configuration box of a module, write as follows:
MODULE_ID.config ={ ASSIGN_STATEMENTS }
Similarly, assign into a memory box by:
MODULE_ID.memory ={ ASSIGN_STATEMENTS }
If we omit MODULE_ID., we can assign into parameters of the configuration/memory box of the context module (in global, the context module is the agent class).
config ={ ASSIGN_STATEMENTS } memory ={ ASSIGN_STATEMENTS }
We can define a composite module as a new module type, which can include any number of the other modules, and can be used like a module written in C++. We refer to an included module as a sub-module. The composite module is defined as follows:
composite CMODULE_NAME { STATEMENTS_IN_CMP }
Note that, a composite module can include the other composite modules.
In default, a new composite module has no ports, no configuration parameters, and no memory parameters. These are added by exporting those of the sub-modules.
export MODULE_ID.config.PARAM_ID as_is export MODULE_ID.config.PARAM_ID as EXPORT_NAME export MODULE_ID.memory.PARAM_ID as_is export MODULE_ID.memory.PARAM_ID as EXPORT_NAME export MODULE_ID.PORT_ID as_is export MODULE_ID.PORT_ID as EXPORT_NAME
The export with .config or .memory exports the configuration or the memory parameter of the sub-module; otherwise, it exports the port. By specifying as_is, the same identifier of parameter or port is used; using as+EXPORT_NAME, we can specify the exporting name.
If a parameter of a sub-module is not exported, the only way to modify the parameter from outside is using the edit statement:
edit CMODULE_ID { STATEMENTS_IN_EDIT }
A composite module can be inherited from the other composite module(s).
inherit CMODULE_NAME inherit_prv CMODULE_NAME
Using inherit keeps the export configuration of the parent module, while using inherit_prv removes the every export configuration.
A function can be defined as follows:
def FUNCTION_NAME(PARAMETER_LIST) { STATEMENTS_IN_DEF }
A function can return a value as follows:
return EXPRESSION_BLOCK
Defined function can be called as:
FUNCTION_NAME(ARGUMENT_LIST)
FUNCTION_NAME : Name of the function. ARGUMENT_LIST : List of arguments. Each argument is a EXPRESSION_BLOCK (refer to #Assign_Sentence).
In the current implementation, only the if statement is defined.
if(EXPRESSION_BLOCK) { STATEMENTS_TRUE } else { STATEMENTS_FALSE }
statement_include statement_include_once statement_linclude statement_dump1 statement_dump2 statement_print statement_destroy
#codeh(cpp){{
}}
The following statements are available in ASSIGN_STATEMENTS.
statement_print statement_starting_with_identifier statement_primitive_assign statement_composite_assign statement_elemental_assign statement_elemental_primitive_assign statement_elemental_composite_assign statement_push statement_push_primitive statement_push_composite statement_fill_all statement_fill_all_primitive statement_fill_all_composite statement_function_call statement_unexpected
#codeh(cpp){{
}}
EXPRESSION_BLOCK