设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14036|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! S+ N0 V+ k6 k* X* A# |) {9 K7 D
! V$ |$ F$ u; J
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。6 H% x3 W6 I% ]8 V; |
1 c) Y9 d) R7 P
begin P_read arriving; I! D+ W4 v* s5 j: `$ Q" r
    while 1=1 do begin! F! \0 C4 F( b
        read A_tote from "data.txt" with delimiter "\n"
/ a; u8 s  \, ?! o        read A_time from "data.txt" with delimiter "\n"
. N/ `$ {0 n! x0 a: \2 O! u1 e4 [( H6 u        read A_leave from "data.txt" with delimiter "\n"
! I  c1 r  N$ `' C        read A_picks from "data.txt" with delimiter "\n"
/ R' Z- o8 J" ]) W        set load type to A_tote  o7 b+ `$ W1 N" ?5 q& m
        if A_tote="tote 1" then set A_induct to 1+ R1 l: ?: L2 w
        else if A_tote="tote 2" then set A_induct to 20 Q- l7 @7 d; m6 j  R9 G+ R3 ?
            else set A_induct to 3   
8 r. U, U! }) O6 b' B3 I        set A_i to 09 d2 N% y+ w) f8 b
        clone 1 load to P_induction# ]4 {. V# w" H3 \# Y  e9 V1 ~# _% M
        wait for A_time sec
# o$ m) _, ~# \& I! v    end) g/ L; w6 `. J* z* r2 u
end
' M% s; T( s. f; S: A5 q4 S7 H  u6 A' ^$ g! H( W8 |+ U* R9 Y
begin P_induction arriving
5 S  d) v6 H9 @. s" m& ?    if A_induct=1 then clone 1 load to P_pick1
* t! U- [' B; K8 l    else if A_induct=2 then clone 1 load to P_pick2" b) ~* F- c$ k5 ~
        else clone 1 load to P_pick3
6 B( I  g  K, q6 H" uend
( P, c0 i7 m& _8 C2 C
, _2 e1 u5 a8 q& i7 C* F+ i+ h$ Fbegin P_pick1 arriving$ _+ x* i- F0 }& Q3 s
    set A_i to 1
$ ^7 W( Z. I% N' k; A    move into Q_induct1( b3 X" X2 e/ V- p6 q  h
    move into pickaisle.induct1) Q7 I. j4 w6 f2 k5 W4 C9 v+ I
    while A_i<=30 do begin
& C% Y0 g5 M: H: J( j. x; L        travel to pickaisle.con(A_i)
& N$ {: a8 Z: }3 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' R3 }0 c8 H* A; g        else wait for 10 sec
, n: d9 l/ h2 t! h  j5 W' A        if A_i=A_leave then send to die9 [$ ]/ x4 u  _
        else inc A_i by 1
' j+ M. \: B9 v" K/ P# T    end6 B: B% {( j" |. x! r
end
& }: i# A+ [; \% e6 g' O
4 n" E( M* z. M* z# @begin P_pick2 arriving0 ]4 j) J% e1 W1 g/ O% I
    set A_i to 11& v! _( r/ d# Q+ S- R/ n. U7 t
    move into Q_induct24 e7 x' O; h& \, y/ f
    move into pickaisle.induct2" d1 x7 R9 Z+ }7 r: u3 a8 O: p
    while A_i<=30 do begin5 e" L9 i1 E7 t" q3 D1 q
        travel to pickaisle.con(A_i)# P8 K  m& i- O. Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ m& F9 I4 Z, w0 R  x4 v
        else wait for 10 sec9 o2 W4 @& m+ a9 ~) D
        if A_i=A_leave then send to die1 x3 r8 ?! ^# ~9 R
        else inc A_i by 1
' U+ }# r+ z" G1 T    end1 I! D7 p4 \; [5 P; c1 X5 [- G
end
4 C1 G$ f. l: G/ K! c8 _% z$ j  x/ I3 k4 U
begin P_pick3 arriving
2 W% B- l5 i. [/ g! r    set A_i to 21
0 d- W; ]. h9 L( M8 ?; a    move into Q_induct3  A3 Z- L  ~( U0 F2 S
    move into pickaisle.induct3
- e% T2 A4 R/ k4 _, g7 {4 o+ n    while A_i<=30 do begin
8 t& P/ o( h, ]. g5 E( m        travel to pickaisle.con(A_i)6 _) k' R6 }8 w* i; K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ @  v# ~% R* w2 v3 K        else wait for 10 sec* n0 W9 Z  `" p
        if A_i=A_leave then send to die, x3 ~, r  T# Q& ]: Y; a
        else inc A_i by 1% U( T! h5 N! W+ g
    end* L9 N# Q% P% O
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
- x3 b9 U, Y2 r3 b  wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 d- M7 n+ e, E4 C( z3 k/ Z
3 a/ E' N8 N* P- \4 EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 x7 a! m$ o8 ?5 k- P' b
+ U4 g7 P% e" Q( C另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 {$ w, `, k! K5 f; b  }. L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 L7 W" f, f( P; j
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# t. Z  v/ k; ?9 j/ N) q: _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% ]0 c1 O& Y4 i( Z( j
begin P_induction arriving9 t& n4 S4 n7 a3 i* }0 Q7 B9 @
    clone 1 load to P_pick(A_induct)
+ c( o( g1 {$ W- t% u1 \end最大的系: ^" C* e, b$ E+ R& g5 a# a* L- E
* b8 n4 Z9 c+ b: I5 S
begin P_pick arriving
- v) D# G, `7 T& J    set A_i to procindex * 10 + 1
9 U8 w# q) U$ h- s5 g    move into Q_induct(procindex). _) z  W( a& o$ Y: Y+ Q8 U, @
    move into pickaisle.induct(procindex)
0 [* K) W7 t8 _9 H6 r. B    /*check the type of pickaisle.induct(i), for your last problem.*/. a7 Z* }0 S+ I) i; X

  n5 `: ]6 L& P# X. p    while A_i<=30 do begin' X9 `3 L; L3 V1 F
        travel to pickaisle.con(A_i)3 n; o) c8 S" X1 q% T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 n' q! O1 F* `/ A1 E- d& N
        else wait for 10 sec
" v  u9 e/ f4 K8 ~' D; A        if A_i=A_leave then send to die+ A/ e9 B2 d) {1 N
        else inc A_i by 1% @9 R& }' y& D9 k; `! K3 A  \5 |
    end1 \- a, T2 v& y# V7 T% H
end
  B. o6 m; m: |. U4 e/ W5 i: n# Z
% _. d( s5 R2 |  Y其中的procindex为整形,代表当前process的序号。2 B: B) ^, [8 I0 C+ x4 x0 R1 _' B
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-6-1 20:51 , Processed in 0.013200 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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