全球FlexSim系统仿真中文论坛

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

Flexsim实体类型

[复制链接]
跳转到指定楼层
1#
zorsite 发表于 2022-10-28 12:05:17 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 zorsite 于 2022-10-28 14:14 编辑
* Q9 c. O4 S" s# J% w( K! H5 ~- [% b3 I/ v7 O3 g0 N' c
Flexsim可以通过isclasstype函数判断实体类型。
+ u1 I. q  H. ?) o0 Eisclasstype (obj object, num/str classtype)
- S- d" j# R6 M* X
  ^0 r- B  g7 DCompares the object to classtype, returns 1 for yes, 0 for no/ X% D, k$ |* J* ~! ~/ s0 k
Description1 |" }7 Y/ _6 N
Returns whether or not the object is of the given classtype. 1 means yes, 0 means no. Possible classtype parameters are:1 F! J# B' c8 a5 @# ?4 v
CLASSTYPE_FLEXSIMOBJECT2 |( x' C% A8 C
CLASSTYPE_FIXEDRESOURCE
5 Y, f; T0 t! H* b, W8 ^CLASSTYPE_TASKEXECUTER
5 \; j2 M/ V. G0 H; ~( O/ A% hCLASSTYPE_NETWORKNODE
% W$ c% O4 p# x2 A2 c+ T$ u- R& Cetc.
/ G. S) ^& h1 k) G9 q; V0 [! B
/ i( U9 Z! u* z9 kExample5 H! i/ D1 C2 W- ^4 u' x8 ?* M1 v
isclasstype(current, CLASSTYPE_DISPATCHER);: S! @' u: X. |$ H8 O
' O( R8 G' }* }7 \
* Z/ k2 }& q; ~; T6 J
: B: Y4 s2 ?8 i2 a& @5 k
Flexism有以下实体类型:7 W+ s1 N  z2 D8 w# r
  1. isclasstype(current,CLASSTYPE_CONVEYOR);
      k& [! w- w# d( L( L4 V* j
  2. isclasstype(current,CLASSTYPE_DISPATCHER);5 Z/ ^& u& b% S2 o  O2 U* a
  3. isclasstype(current,CLASSTYPE_FIXEDRESOURCE);  [# w) Z2 U* R/ w0 M) |
  4. isclasstype(current,CLASSTYPE_FLEXSIMEVENTHANDLER);
    ; l* m: `6 E4 L3 a  h& e; l
  5. isclasstype(current,CLASSTYPE_FLEXSIMOBJECT);
    5 O$ s* x4 C3 H
  6. isclasstype(current,CLASSTYPE_FLUIDOBJECT);' _4 }0 n  i: @. t
  7. isclasstype(current,CLASSTYPE_FLUIDOBJECT2);
    $ ]6 s3 O* N3 Y
  8. isclasstype(current,CLASSTYPE_LINECONTROLLER);
    : \( ]/ C( n0 ?
  9. isclasstype(current,CLASSTYPE_MERGESORT);/ ^4 g8 j1 D/ D* |6 N+ ]" p
  10. isclasstype(current,CLASSTYPE_MTBFMTTR);
    # W# ^; b  U9 q! L, a1 |
  11. isclasstype(current,CLASSTYPE_NAVIGATOR);
    9 G* T3 K' q, c% |4 \
  12. isclasstype(current,CLASSTYPE_NETWORKNODE);& r$ t/ T) b& t8 t$ S
  13. isclasstype(current,CLASSTYPE_ODT);
    7 `. Z+ @4 L' w4 G6 L- {* W
  14. isclasstype(current,CLASSTYPE_OWNERDRAWN);  y$ U4 m. C  Y. g
  15. isclasstype(current,CLASSTYPE_PROCESSOR);" t2 U! i# \2 v* [! d' P) A# e
  16. isclasstype(current,CLASSTYPE_SYSTEMCONTROLLER);) R$ [) z7 u- h2 `' A2 \
  17. isclasstype(current,CLASSTYPE_TASKEXECUTER);
    3 H2 z' F! h, |. Q3 L& h: `
  18. isclasstype(current,CLASSTYPE_TRAFFICCONTROLLER);' s: N2 P6 n4 T1 c7 h
  19. isclasstype(current,CLASSTYPE_VISUALTOOL);
    7 o) C3 j! M! M( r+ q! n' c
  20. isclasstype(current,CLASSTYPE_WANTCONNECTLOGIC);
复制代码

( V0 W9 O4 n5 M+ Q1 ^  [. i, k7 h$ b+ l) ~- S0 U
isclasstype 的第2个参数应该是数字或文本,正常情况下函数应该写作:
  1. isclasstype(current,"Processor");
复制代码
或者0 a, c. h7 S4 M' u
  1. isclasstype(current,64);
复制代码

/ e" R1 \( M1 S# B) G在代码中使用数字不便于理解代码,使用文本时需要注意大小写,而且需要加引号,也常会出现拼写错误。
8 |2 g7 O7 b: A) z4 X3 c5 l% QFlexsim将常用实体类型设置为常量,可以在代码中直接引用,不仅可以自动补全,也便于代码的阅读和理解。
2 a3 c$ u& F7 m7 K, z4 D# A: L% n. A5 u& t, [

2 G9 j' U& f6 f: \( O4 F% b, c0 c- C1 r* w# m! E0 T* a
2#
 楼主| zorsite 发表于 2022-10-31 21:21:49 | 只看该作者
本帖最后由 zorsite 于 2022-10-31 21:23 编辑
. h  `  V6 Z+ ~& z) g  C: F& V+ {
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, 2024-5-25 03:36 , Processed in 0.062840 second(s), 14 queries .

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

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