Class Mapping File

Class Mapping File Rules

The class mapping file is created following the rules listed below. The rules follow the BNF conventions (see “BNF Notation” on page 39 for the complete BNF conventions). Specifically:

  • Tokens in bold should be typed exactly as shown.
  • Tokens enclosed in angle brackets (<Type>) should be replaced by the value represented by that token, based on the appropriate BNF rule. The exception is the string <Tag> which should be typed exactly as shown.
  • A vertical bar ( | ) is used to indicate alternative possible values.
<MapFile> ::=	( mapping version 2 [<Mapping>]+ )
<Mapping> ::=	<TypeDefs> | <ObjectMaps> | <InterMaps>
<TypeDefs> ::=	( types [<TypeDef>]+ )
<TypeDef> ::=	( <Name> [<FieldDefs>]+ )
<FieldDefs> ::=	( attribute <FOM_Name> <OPNET_Name> <Type>)
<Type> ::=	<FOM_Type> | <Name>
<FOM_Type> ::=	<IntegerType>	| <FloatType>	|
	boolean	| string
<IntegerType> ::=	short	| unsigned_short 	|
	long	| unsigned_long	|
	long_long	| unsigned_long_long	|
	char	| octet
<FloatType> ::= 	float	| double
<ObjectMaps> ::= 	( objects [<ObjMap>]+ )
<ObjMap> ::= 	( class <ObjClass> [<ObjAttr>]+ [<ObjMap>]* )
<ObjClass> ::= 	<HLAClassName> <OpnetObject> <OpnetMobility> <ClassSet> <Create>
<OpnetObject> ::= 	node | subnet | all
<OpnetMobility> ::=	fixed | mobile | satellite 	| any
<ClassSet> ::=	( class_set <OpnetObjectMatch> )
<OpnetObjectMatch> ::=	( <AttrName> <Oper> <Value> <OPNET_Type> )		|
	(not <OpnetObjectMatch> )			|
	( and <OpnetObjectMatch> <OpnetObjectMatch> )			|
	( or <OpnetObjectMatch> <OpnetObjectMatch> )
<Oper> ::=	 == | != | < | <=	| > | >= | prefix	| contains | suffix
<OPNET_Type> ::=	integer | boolean | double | string
<Create> ::=	( creation_mode <CreateMode> )
<CreateMode> ::=	create [ <AttrName> <Type> ]			|
	discover <RTIMatch>			|
		dynamic <RTIMatch>
<RTIMatch> ::= 	attr_match <AttrName>			|
		name_match <AttrName> <Type>
<ObjAttr> ::= 	( attribute <HLAName> <AttrName> <Type> <PS> )
<AttrName> ::= 	<Name> | <Name> [ <Number> ] . <AttrName>
<PS> ::= 	P | S
<InterMaps> ::=	( interactions [<InterMap>]+ )
<InterMap> ::=	( class <InterClass> [<InterParam>]+ [<InterMap>]* )
<InterClass> ::=	<HLAInteractionName> <OPNETPacketName>
<InterParam> ::=	( parameter <HLAParamName> <OPNETFieldName> <HLAParamType> )
<HLAParamName> ::=	<Name> | <tag>
<HLAParamType> ::=	<IntegerType> | <FloatType> | boolean | structure

Sample Class Mapping Files

Sample Object Creation Class Mapping File

This file uses the create creation mode, applying rules shown in Class Mapping File.

( mapping version 2
  ( types
    ( Info_Type
      ( attribute number_units “Number Units” long )
      ( attribute cost          Cost          double )
      ( attribute brand         Brand         string )
    )
  )
  ( objects
    ( class hla_object node fixed
      ( class_set ( model == HLA_Object string ) )
      ( creation_mode create name string )
      ( attribute update_request  “Update Request”  long         S )
      ( attribute update_time     “Update Time”     double       P )
      ( attribute information      Information      Info_Type    P )
    )
  )
)

Sample Object Discovery Class Mapping File

This file uses the dynamic creation mode, applying rules shown in Class Mapping File.

( mapping version 2
  ( types
    ( Info_Type
      ( attribute number_units “Number Units” long )
      ( attribute cost          Cost          double )
      ( attribute brand         Brand         string )
    )
  )
  ( objects
    ( class hla_object node fixed
      ( class_set ( model == HLA_Object string ) )
      ( creation_mode dynamic name_match name string )
      ( attribute update_request  “Update Request”  long         S )
      ( attribute update_time     “Update Time”     double       P )
      ( attribute information      Information      Info_Type    P )
    )
  )
)

Sample Interactions Class Mapping File

This file applies rules shown in Class Mapping File.

( mapping version 2
  ( interactions
    ( class send_info Send_Info
      ( parameter number_ids  “number ids” long )
      ( parameter ids          ids         structure )
    )
    ( class info_reply Info_Reply
      ( parameter opnet_id      “opnet id”      long )
      ( parameter num_elements  “num elements”  long )
      ( parameter information    information    structure )
    )
    ( class stop_listening Stop_Listening
      ( parameter opnet_id “opnet id” long )
    )
  )
)

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com