全球FlexSim系统仿真中文论坛

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

Flexsim实体类型

[复制链接]
跳转到指定楼层
1#
zorsite 发表于 2022-10-28 12:05:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 zorsite 于 2022-10-28 14:14 编辑 ! C) U! w- b/ @& h* n. D

8 j! C) a: N+ z8 qFlexsim可以通过isclasstype函数判断实体类型。) d( G# {+ G2 ]4 l
isclasstype (obj object, num/str classtype)
1 N. c; R! y8 U% }3 C2 ~- c) I+ K. L; b! m: ?1 }
Compares the object to classtype, returns 1 for yes, 0 for no
3 z9 e! q! H9 zDescription( h8 k& f  R0 v1 \  \
Returns whether or not the object is of the given classtype. 1 means yes, 0 means no. Possible classtype parameters are:! @0 y# T0 C8 I7 t
CLASSTYPE_FLEXSIMOBJECT; _& B8 R) m  }- p8 i3 z
CLASSTYPE_FIXEDRESOURCE
) T4 P6 U; x5 q1 o1 LCLASSTYPE_TASKEXECUTER+ p9 J# w7 B9 Q' Y$ v) \  @
CLASSTYPE_NETWORKNODE1 a! G8 W- I* D1 z3 m) N
etc.$ K; s% o6 w  P2 U" `1 P
5 ^$ `% D) _6 t% U* ]( I7 @2 Z
Example' r! W9 l0 u8 B7 x2 l
isclasstype(current, CLASSTYPE_DISPATCHER);4 s- @& P/ V' M& s0 b
8 `( \- F/ G  D! H! B$ M/ ?4 W

! O3 G- H% z5 P% r
' a: B+ l* @3 S& F, `2 ~; BFlexism有以下实体类型:
' v8 s6 h5 `5 @% }
  1. isclasstype(current,CLASSTYPE_CONVEYOR);! O) [9 |3 V4 U$ v7 Y$ b
  2. isclasstype(current,CLASSTYPE_DISPATCHER);
    0 I; Z) D7 I$ s3 B
  3. isclasstype(current,CLASSTYPE_FIXEDRESOURCE);
    * A$ B# c. Y" G" _
  4. isclasstype(current,CLASSTYPE_FLEXSIMEVENTHANDLER);
    , w; ]7 i) j) g% w/ G7 r
  5. isclasstype(current,CLASSTYPE_FLEXSIMOBJECT);& v% t5 q$ H+ b
  6. isclasstype(current,CLASSTYPE_FLUIDOBJECT);% w; R8 s4 [/ G3 W3 X
  7. isclasstype(current,CLASSTYPE_FLUIDOBJECT2);
    / ?9 A! L& G- M3 n
  8. isclasstype(current,CLASSTYPE_LINECONTROLLER);
    ! z, `1 v) ]) o, W1 s$ T) C
  9. isclasstype(current,CLASSTYPE_MERGESORT);
    + d! b0 [- ?  l; R! O* P% l
  10. isclasstype(current,CLASSTYPE_MTBFMTTR);
    6 |5 q5 t; y3 M/ z: ^
  11. isclasstype(current,CLASSTYPE_NAVIGATOR);4 d7 l# ]( d1 h' U
  12. isclasstype(current,CLASSTYPE_NETWORKNODE);3 V" G( t5 h4 r, [+ Q5 S
  13. isclasstype(current,CLASSTYPE_ODT);7 d/ J; E1 T" _) p3 L6 G
  14. isclasstype(current,CLASSTYPE_OWNERDRAWN);
    1 e/ @7 [+ O3 a5 J
  15. isclasstype(current,CLASSTYPE_PROCESSOR);
    : ~- p/ d5 L% c* m+ W1 x  ^
  16. isclasstype(current,CLASSTYPE_SYSTEMCONTROLLER);, L. K% R, k& E7 P- Q' e
  17. isclasstype(current,CLASSTYPE_TASKEXECUTER);
    7 k0 D0 @$ ?# z: R( Q$ r" t8 z6 |, x
  18. isclasstype(current,CLASSTYPE_TRAFFICCONTROLLER);
    & h$ U7 U) u3 |8 r
  19. isclasstype(current,CLASSTYPE_VISUALTOOL);
    ( ^2 W- B% e2 S+ K7 [2 j  C
  20. isclasstype(current,CLASSTYPE_WANTCONNECTLOGIC);
复制代码
/ B* h" @7 U$ b0 a" t

3 X, j8 V: n, a& b* Cisclasstype 的第2个参数应该是数字或文本,正常情况下函数应该写作:
  1. isclasstype(current,"Processor");
复制代码
或者4 v0 D6 ^, L3 b8 J8 H8 c& t# Z
  1. isclasstype(current,64);
复制代码
- n6 `( l: G/ |" S
在代码中使用数字不便于理解代码,使用文本时需要注意大小写,而且需要加引号,也常会出现拼写错误。/ W$ ?2 W1 o4 r! x! f6 N5 e# V/ p- m
Flexsim将常用实体类型设置为常量,可以在代码中直接引用,不仅可以自动补全,也便于代码的阅读和理解。) d) B3 t* R; ^  i

8 w& b! z- ]4 c- f. |: }9 t6 @5 Q) L1 c6 D3 a
6 L! r( E3 z- A- e- A+ J$ V
2#
 楼主| zorsite 发表于 2022-10-31 21:21:49 | 只看该作者
本帖最后由 zorsite 于 2022-10-31 21:23 编辑 # i7 I+ @& P% B; t5 Y
$ _& o, Q+ q6 l* G9 a5 d* y$ B" m
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-25 07:21 , Processed in 0.069904 second(s), 14 queries .

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

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