全球FlexSim系统仿真中文论坛

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

Flexsim实体类型

[复制链接]
跳转到指定楼层
1#
zorsite 发表于 2022-10-28 12:05:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 zorsite 于 2022-10-28 14:14 编辑
& X$ p  y, s' O0 @$ S& G* o
" M* j/ k7 Z) H1 B2 O0 E: ~! ?- DFlexsim可以通过isclasstype函数判断实体类型。- z: p  ]( N' M; ~/ F* J$ `, g+ ?. B
isclasstype (obj object, num/str classtype)3 y) ^" B% @" t% \) l- p
1 ]: Z; m" W' N& j
Compares the object to classtype, returns 1 for yes, 0 for no' U' ^7 T% G& @& M% {) {. H3 ]) t' J
Description( h' ~* h; m! M% ~  [% U
Returns whether or not the object is of the given classtype. 1 means yes, 0 means no. Possible classtype parameters are:4 N* A/ @+ {; a, t: D  z
CLASSTYPE_FLEXSIMOBJECT7 `* D7 B9 g" L8 s% I
CLASSTYPE_FIXEDRESOURCE
! ^# {$ u! |% C- q  ?$ l, RCLASSTYPE_TASKEXECUTER* z! m3 t9 @2 z
CLASSTYPE_NETWORKNODE
$ D0 |9 v( |+ ]6 P; ~+ n& petc.* z9 t! q5 B/ B2 Z$ n
* m+ `6 X/ {8 O! `" k8 \) ]
Example& Q; w5 f) K( w* ~5 Q+ B. v# E
isclasstype(current, CLASSTYPE_DISPATCHER);
& l, `1 K3 n0 _5 ^9 }0 S0 u9 ~
' [1 ~$ l! h5 _$ _7 q5 T  r
, {+ k7 {! V. W* r& }& x7 h) N: Y) k& p
Flexism有以下实体类型:; G" _! Z. T1 S
  1. isclasstype(current,CLASSTYPE_CONVEYOR);' Z. i+ j% O2 n# h
  2. isclasstype(current,CLASSTYPE_DISPATCHER);1 R" S% w# G3 l0 ?. D8 D( {1 t  o
  3. isclasstype(current,CLASSTYPE_FIXEDRESOURCE);: H/ w5 A! y: w+ r: }
  4. isclasstype(current,CLASSTYPE_FLEXSIMEVENTHANDLER);
    ' y- R, h- ?; l, R; d4 {
  5. isclasstype(current,CLASSTYPE_FLEXSIMOBJECT);
    & u/ Y; Y6 h" M  q' h
  6. isclasstype(current,CLASSTYPE_FLUIDOBJECT);- L& g* h5 L& z
  7. isclasstype(current,CLASSTYPE_FLUIDOBJECT2);7 _: @& R8 b( _/ x2 _% C7 b
  8. isclasstype(current,CLASSTYPE_LINECONTROLLER);+ J3 j& J! g) ^1 Z/ H
  9. isclasstype(current,CLASSTYPE_MERGESORT);% T; r' ]2 ~4 x
  10. isclasstype(current,CLASSTYPE_MTBFMTTR);
    ! n, s0 M& Z( _; b
  11. isclasstype(current,CLASSTYPE_NAVIGATOR);
    1 ^6 Y6 f7 k6 K' u  s
  12. isclasstype(current,CLASSTYPE_NETWORKNODE);
    - m+ p  C: C, v. v9 F
  13. isclasstype(current,CLASSTYPE_ODT);7 ?+ Y9 z( F4 o1 W% e+ z; L
  14. isclasstype(current,CLASSTYPE_OWNERDRAWN);
    . W5 j$ B! ?0 L: x* h3 p
  15. isclasstype(current,CLASSTYPE_PROCESSOR);4 `9 ]3 G5 I4 Z" k1 }# G
  16. isclasstype(current,CLASSTYPE_SYSTEMCONTROLLER);
    " q, O. @7 r# H( K
  17. isclasstype(current,CLASSTYPE_TASKEXECUTER);  E$ d1 j! V* O# G
  18. isclasstype(current,CLASSTYPE_TRAFFICCONTROLLER);
    : }! \. k9 A- A4 y: M# ~
  19. isclasstype(current,CLASSTYPE_VISUALTOOL);
    % B; A/ @0 {/ r: a3 u, d. t8 m
  20. isclasstype(current,CLASSTYPE_WANTCONNECTLOGIC);
复制代码
2 o; f6 h4 h' Q5 u% L8 }( x
/ V" Q" q5 E( h7 r
isclasstype 的第2个参数应该是数字或文本,正常情况下函数应该写作:
  1. isclasstype(current,"Processor");
复制代码
或者7 I' `" W9 F0 l/ r' p
  1. isclasstype(current,64);
复制代码
; \7 M" I0 x/ R6 J$ s% d
在代码中使用数字不便于理解代码,使用文本时需要注意大小写,而且需要加引号,也常会出现拼写错误。
- w  J. o1 Z# M# T3 A  N  }2 L# H3 E! SFlexsim将常用实体类型设置为常量,可以在代码中直接引用,不仅可以自动补全,也便于代码的阅读和理解。
; M0 c. A7 n# w- Y* c% o
4 [2 l- C, `, {0 c' @) Z0 c+ @( i5 \6 A6 ?# W
5 Q- q; M: u! |9 [% ^
2#
 楼主| zorsite 发表于 2022-10-31 21:21:49 | 只看该作者
本帖最后由 zorsite 于 2022-10-31 21:23 编辑
0 V4 {- W, g* k# n
3 E& c' ~; w$ w+ Z& P
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-7-9 22:47 , Processed in 0.075712 second(s), 13 queries .

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

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