OMNeT++向量设备位置布局与INET移动设备位置布局

OMNeT++向量设备位置布局

@display特性

@display=("p=p[0],p[1],p[2],p[3],p[4,p[5]]")
参数
p[0] - xX position of the center of the icon/shape; defaults to automatic graph layouting
p[1] - yY position of the center of the icon/shape; defaults to automatic graph layouting
p[2] - arrangementArrangement of submodule vectors. Values: row (r), column (c), matrix ( m ), ring (ri), exact (x)
p[3] - arr. par1Depends on arrangement: matrix => ncols, ring => rx, exact => dx, row => dx, column => dy
p[4] - arr. par2Depends on arrangement: matrix => dx, ring => ry, exact => dy
p[5] - arr. par3Depends on arrangement: matrix => dy

通过设置6个参数可以实现设备横、纵、矩阵、环、exact(这个不懂)布局。

INET移动设备

INET移动设备[设备数量]若定义@display仿真会报错,需要删掉第三个参数。

mobility参数

该类设备以INET提供的WirelessHost为代表,定义其静态位置需要通过mobility参数。

*.host[.].mobility.typename = "模型名"

INET提供三种不运动的静止模型。

模型名解释
StationaryMobility提供确定性(设置初始位置)和随机定位(不设置初始位置)
StaticGridMobility将多个移动模型放置在矩形网格中(类似@display特性中matrix布局)
StaticConcentricMobility将几个模型放在一组同心圆中

StationaryMobility

该模型通过设置各设备初始位置确定设备向量中各设备位置。

haic.gateway[*].mobility.typename="StationaryMobility"
haic.gateway[*].mobility.initFromDisplayString=false		#默认为true,需手动设置为false
haic.gateway[0].mobility.initialX=200m
haic.gateway[0].mobility.initialY=300m
haic.gateway[0].mobility.initialZ=0m
haic.gateway[1].mobility.initialX=600m
haic.gateway[1].mobility.initialY=300m
haic.gateway[1].mobility.initialZ=0m

INET用户手册中提供了完整的参数列表

变量名数据类型默认值描述
subjectModulestring“^”module path which determines the subject module, the motion of which this mobility model describes, the default value is the parent module
coordinateSystemModulestring“”module path of the geographic coordinate system module
displayStringTextFormatstring“p: %p\nv: %v”format string for the mobility module’s display string text
updateDisplayStringbooltrueenables continuous update of the subject module’s position via modifying its display string
constraintAreaMinXdouble-inf mmin x position of the constraint area, unconstrained by default (negative infinity)
constraintAreaMinYdouble-inf mmin y position of the constraint area, unconstrained by default (negative infinity)
constraintAreaMinZdouble-inf mmin z position of the constraint area, unconstrained by default (negative infinity)
constraintAreaMaxXdoubleinf mmax x position of the constraint area, unconstrained by default (positive infinity)
constraintAreaMaxYdoubleinf mmax y position of the constraint area, unconstrained by default (positive infinity)
constraintAreaMaxZdoubleinf mmax z position of the constraint area, unconstrained by default (positive infinity)
initialXdoubleuniform(this.constraintAreaMinX, this.constraintAreaMaxX)
initialYdoubleuniform(this.constraintAreaMinY, this.constraintAreaMaxY)
initialZdoublenanToZero(uniform(this.constraintAreaMinZ, this.constraintAreaMaxZ))
initialLatitudedoublenan deg
initialLongitudedoublenan deg
initialAltitudedouble0m
initialHeadingdouble0deg
initialElevationdouble0deg
initialBankdouble0deg
initFromDisplayStringbooltrueenables one time initialization from the subject module’s display string
updateFromDisplayStringbooltrueenables continuous update from the subject module’s display string for dragging and rotating it

StaticGridMobility

该模型通过设置设备数、设备行列数设置布局。

#设备以网格布局分布在以下区域
haic.host[*].mobility.constraintAreaMaxX = 800m
haic.host[*].mobility.constraintAreaMinX = 0m
haic.host[*].mobility.constraintAreaMaxY = 800m
haic.host[*].mobility.constraintAreaMinY = 400m
haic.host[*].mobility.constraintAreaMaxZ = 0m
haic.host[*].mobility.constraintAreaMinZ = 0m

haic.host[*].mobility.typename="StaticGridMobility"
haic.host[*].mobility.columns = 6
haic.host[*].mobility.numHosts = 12							#必须设置设备数量

INET用户手册中的全部参数

变量名数据类型默认值描述
subjectModulestring“^”module path which determines the subject module, the motion of which this mobility model describes, the default value is the parent module
coordinateSystemModulestring“”module path of the geographic coordinate system module
displayStringTextFormatstring“p: %p\nv: %v”format string for the mobility module’s display string text
updateDisplayStringbooltrueenables continuous update of the subject module’s position via modifying its display string
constraintAreaMinXdouble-inf mmin x position of the constraint area, unconstrained by default (negative infinity)
constraintAreaMinYdouble-inf mmin y position of the constraint area, unconstrained by default (negative infinity)
constraintAreaMinZdouble-inf mmin z position of the constraint area, unconstrained by default (negative infinity)
constraintAreaMaxXdoubleinf mmax x position of the constraint area, unconstrained by default (positive infinity)
constraintAreaMaxYdoubleinf mmax y position of the constraint area, unconstrained by default (positive infinity)
constraintAreaMaxZdoubleinf m max z position of the constraint area, unconstrained by default (positive infinity)
marginXdouble0m
marginYdouble0m
numHostsint
columnsintint(ceil(sqrt(numHosts * (this.constraintAreaMaxX - this.constraintAreaMinX - 2 * marginX) / (this.constraintAreaMaxY - this.constraintAreaMinY - 2 * marginY))))
rowsintint((numHosts + columns - 1) / columns)
initialZdouble0m
separationXdouble(this.constraintAreaMaxX - this.constraintAreaMinX - 2 * marginX) / columns
separationYdouble(this.constraintAreaMaxY - this.constraintAreaMinY - 2 * marginY) / rows

StaticConcentricMobility

INET用户手册全部参数

变量名数据类型默认值描述
subjectModulestring“^”module path which determines the subject module, the motion of which this mobility model describes, the default value is the parent module
coordinateSystemModulestring“”module path of the geographic coordinate system module
displayStringTextFormatstring“p: %p\nv: %v”format string for the mobility module’s display string text
updateDisplayStringbooltrueenables continuous update of the subject module’s position via modifying its display string
constraintAreaMinXdouble-inf mmin x position of the constraint area, unconstrained by default (negative infinity)
constraintAreaMinYdouble-inf mmin y position of the constraint area, unconstrained by default (negative infinity)
constraintAreaMinZdouble-inf mmin z position of the constraint area, unconstrained by default (negative infinity)
constraintAreaMaxXdoubleinf mmax x position of the constraint area, unconstrained by default (positive infinity)
constraintAreaMaxYdoubleinf mmax y position of the constraint area, unconstrained by default (positive infinity)
constraintAreaMaxZdoubleinf mmax z position of the constraint area, unconstrained by default (positive infinity)
numHostsint
initialZdouble0m
distancedouble100m
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值