全球FlexSim系统仿真中文论坛

搜索
查看: 2811|回复: 1
打印 上一主题 下一主题

Flexsim实体类型

[复制链接]
跳转到指定楼层
1#
zorsite 发表于 2022-10-28 12:05:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 zorsite 于 2022-10-28 14:14 编辑
& r& q/ F/ J% g0 @8 Q" M$ W* d0 [/ e- A, K8 H
Flexsim可以通过isclasstype函数判断实体类型。
: J$ B2 F" [0 kisclasstype (obj object, num/str classtype)
% P6 N/ M6 I4 x8 v! e: j' t  _0 W5 d3 U" O
Compares the object to classtype, returns 1 for yes, 0 for no- o5 f$ G2 |. F8 A
Description+ T9 R/ h$ {9 q5 T! i7 u% [
Returns whether or not the object is of the given classtype. 1 means yes, 0 means no. Possible classtype parameters are:
( n7 B6 k( Y+ A0 l0 mCLASSTYPE_FLEXSIMOBJECT
; ^. l2 X6 L& D- rCLASSTYPE_FIXEDRESOURCE& {7 z, C8 n( |' O
CLASSTYPE_TASKEXECUTER) K/ P) @: H: \, m* ^8 c1 P
CLASSTYPE_NETWORKNODE9 D% a4 P1 {. o9 z5 W
etc.
8 \4 i4 Z- J  d; q8 r3 N
9 \  F5 C9 A$ e( eExample. b& X' z! l5 R3 [% X, u
isclasstype(current, CLASSTYPE_DISPATCHER);
/ b3 }1 f7 D8 m: K3 A
8 ?  i1 I& `7 l( }& q+ d- L! w1 J: v: t8 J& S: O3 Y' Y

: H! r; `$ t; V$ ~5 r# w% J7 BFlexism有以下实体类型:* L( z& _- F' J2 a9 U3 ?
  1. isclasstype(current,CLASSTYPE_CONVEYOR);
    / ?0 G+ w4 ]) n  h
  2. isclasstype(current,CLASSTYPE_DISPATCHER);& c$ C; T4 d3 X0 M" w% W
  3. isclasstype(current,CLASSTYPE_FIXEDRESOURCE);: M& k( i+ m& l. S! Y
  4. isclasstype(current,CLASSTYPE_FLEXSIMEVENTHANDLER);
    0 S1 {3 S$ R" D. I0 E1 P- f
  5. isclasstype(current,CLASSTYPE_FLEXSIMOBJECT);
    0 `( p% {% ~9 R6 \
  6. isclasstype(current,CLASSTYPE_FLUIDOBJECT);
    , C4 `/ s2 q' G; \$ m; @
  7. isclasstype(current,CLASSTYPE_FLUIDOBJECT2);% S, p! \! t1 A- k% R0 H
  8. isclasstype(current,CLASSTYPE_LINECONTROLLER);# }! Q% Q" g4 G/ _! _+ A
  9. isclasstype(current,CLASSTYPE_MERGESORT);
    $ H- N8 @+ N6 Z3 |3 r9 D# k
  10. isclasstype(current,CLASSTYPE_MTBFMTTR);/ r6 P% p. y( Y* @
  11. isclasstype(current,CLASSTYPE_NAVIGATOR);8 V, R$ ^2 l( L
  12. isclasstype(current,CLASSTYPE_NETWORKNODE);
    , c: J" W( M7 g/ q6 H# c+ X8 m+ g
  13. isclasstype(current,CLASSTYPE_ODT);/ ]: P9 f  Q( W" `
  14. isclasstype(current,CLASSTYPE_OWNERDRAWN);
    . }5 K8 k# d. ]1 c* J, _
  15. isclasstype(current,CLASSTYPE_PROCESSOR);. |0 s1 P3 \0 |2 r/ j/ ]" z
  16. isclasstype(current,CLASSTYPE_SYSTEMCONTROLLER);
    % C4 H2 z/ C) }* N5 n3 f9 ]
  17. isclasstype(current,CLASSTYPE_TASKEXECUTER);
    0 q1 Z* c2 l* ?/ }
  18. isclasstype(current,CLASSTYPE_TRAFFICCONTROLLER);
    - q. P+ r- W3 g
  19. isclasstype(current,CLASSTYPE_VISUALTOOL);
    , P1 r+ B" `5 i- e. p3 G
  20. isclasstype(current,CLASSTYPE_WANTCONNECTLOGIC);
复制代码
9 `7 W% b5 T0 [6 j
# D3 ~2 k/ l3 H$ n& p
isclasstype 的第2个参数应该是数字或文本,正常情况下函数应该写作:
  1. isclasstype(current,"Processor");
复制代码
或者
3 v! f7 `9 H4 K7 T* J, J
  1. isclasstype(current,64);
复制代码
4 @; z# y$ K4 k2 _
在代码中使用数字不便于理解代码,使用文本时需要注意大小写,而且需要加引号,也常会出现拼写错误。0 l; n9 A7 M0 u0 t5 {; y5 W8 _; N
Flexsim将常用实体类型设置为常量,可以在代码中直接引用,不仅可以自动补全,也便于代码的阅读和理解。( }5 u- j$ i+ z/ G; `5 V' P. K
  B1 I7 _6 B/ Y
+ C: E' y) l6 W6 r' ]/ E+ D+ A$ _
2 ^4 }0 |; D5 |9 M2 ]
2#
 楼主| zorsite 发表于 2022-10-31 21:21:49 | 只看该作者
本帖最后由 zorsite 于 2022-10-31 21:23 编辑 3 [0 A7 \) |  M) C' Z

3 f) }# }$ z+ D& e6 M# n3 Y
Class TypeClass Type Number
CLASSTYPE_OWNERDRAWN
-2147483648
CLASSTYPE_ODT
1
CLASSTYPE_FLEXSIMOBJECT
2
CLASSTYPE_FIXEDRESOURCE
4
CLASSTYPE_DISPATCHER
8
CLASSTYPE_TASKEXECUTER
16
CLASSTYPE_NAVIGATOR
32
CLASSTYPE_PROCESSOR
64
CLASSTYPE_NETWORKNODE
128
CLASSTYPE_VISUALTOOL
256
CLASSTYPE_CONVEYOR
512
CLASSTYPE_TRAFFICCONTROLLER
1024
CLASSTYPE_MTBFMTTR
2048
CLASSTYPE_MERGESORT
4096
CLASSTYPE_WANTCONNECTLOGIC
8192
CLASSTYPE_FLUIDOBJECT
16384
CLASSTYPE_FLUIDOBJECT2
32768
CLASSTYPE_LINECONTROLLER
65536
CLASSTYPE_SYSTEMCONTROLLER
131072
CLASSTYPE_FLEXSIMEVENTHANDLER
262144
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|全球FlexSim系统仿真中文论坛 ( 京ICP备14043114号-2 )

GMT+8, 2025-10-24 13:33 , Processed in 0.059508 second(s), 13 queries .

Powered by Discuz! X3.3© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表