设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13938|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 P. B. w7 D: j. {2 U1 a

3 E0 x0 p9 k- F/ A6 {我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 C$ c/ X0 j0 i

1 l% D5 A$ r, f1 Obegin P_read arriving
' q8 q' n% S; h0 \    while 1=1 do begin. F" ]. U( Z2 ~3 T
        read A_tote from "data.txt" with delimiter "\n"- s& l& a+ A+ I9 i7 Z4 {
        read A_time from "data.txt" with delimiter "\n"8 t* s3 `# ~) X) J
        read A_leave from "data.txt" with delimiter "\n"
7 ?& C6 n# i( m: y3 U        read A_picks from "data.txt" with delimiter "\n"
8 {+ l. D8 c/ T! k        set load type to A_tote9 X% y% E, y! K' q
        if A_tote="tote 1" then set A_induct to 10 b) I: M7 k, d  l# a
        else if A_tote="tote 2" then set A_induct to 2' l. F& I. S5 Q) q! b0 S! [1 u
            else set A_induct to 3   
! o9 j0 n7 m7 z: ]        set A_i to 0% P$ Y8 d+ S4 {' F
        clone 1 load to P_induction
  s- y9 `' B- L+ E0 N* Q        wait for A_time sec0 n7 Q& W/ p$ x
    end. n' g5 x9 r: d! I5 t. I
end2 ^7 p/ E7 B6 D

/ [/ ]1 E/ {- M0 \begin P_induction arriving
4 f2 i/ z0 p* M/ Z. ^$ A2 r! V    if A_induct=1 then clone 1 load to P_pick1
2 U: @4 i* r+ t! V% v: ^    else if A_induct=2 then clone 1 load to P_pick21 Z. P+ s' H. L2 p2 u  _
        else clone 1 load to P_pick3
2 I, Q! p, q' K- _7 U- B- Zend
% D' Y( @4 b8 [' m% T# o
/ j5 L9 e( y- G" jbegin P_pick1 arriving% B8 h$ h; @0 M1 {, ?. d
    set A_i to 1
. L5 A1 K  O+ |1 K    move into Q_induct1
' y+ v' a6 {. Z6 @) `. n    move into pickaisle.induct1
3 ^4 z. H- c$ b, w6 P& R2 {: @" C    while A_i<=30 do begin0 M* o4 P" P7 y- p" p+ E# ^
        travel to pickaisle.con(A_i)
+ J4 h; q1 d( v7 ?# T3 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) _. D; L- g$ U& v) M: \8 l% v
        else wait for 10 sec
1 m, k$ R6 M0 w  d0 I        if A_i=A_leave then send to die4 y( T1 _: `4 {; p9 s. `7 x/ r# W2 O
        else inc A_i by 1
  @+ @% }3 V* n* _9 L$ d/ T4 j# v    end$ w7 L5 k6 ?9 L$ M7 c
end2 y9 b5 \! ?" z% j* [. U  ]
' A: y# o- W0 h  u- w0 O+ J3 ?
begin P_pick2 arriving) M" t0 ~  v7 e# b5 a# D
    set A_i to 11  Z  E0 d( U( v4 U
    move into Q_induct2
0 q  w- @, g* z5 l, T8 \    move into pickaisle.induct2
" n- I7 d% w: q; y4 m    while A_i<=30 do begin+ b' j5 H  e% b! D2 `
        travel to pickaisle.con(A_i)5 B7 W, B" m4 g; u5 v, ^, P' }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 s/ s, n' M" r/ y# ?% k: L        else wait for 10 sec9 f" t/ P/ j" ]) r: b) |: j
        if A_i=A_leave then send to die( p" c% C# Q: O1 C5 Y
        else inc A_i by 1
* w& G) f. `& V$ W    end1 J  K5 W9 d+ s) F
end
* X* f. c; t% I# P0 h( t2 c1 B! |* j& w, |
begin P_pick3 arriving% u# x8 s2 [4 ~8 z0 A
    set A_i to 218 r  h4 W( a+ e, B; g) t6 _  p# M
    move into Q_induct3. A$ q3 T" `8 r- d5 Y
    move into pickaisle.induct3. U0 W: X+ Q# Y) [$ s' A" y" H
    while A_i<=30 do begin
# H; e+ Y1 }; Z7 b/ ?7 z) u" H: @        travel to pickaisle.con(A_i)2 j4 n& a; v$ H2 h8 ~4 z) J; v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; U+ Q4 N8 {7 Y' f2 V        else wait for 10 sec
7 ]$ P: o8 p+ C7 q1 q        if A_i=A_leave then send to die% a5 w" z( w+ a$ k
        else inc A_i by 1
/ G/ T4 V: D. ^8 s$ ~    end
) n2 s4 p) d5 q% F" \) Iend

最佳答案

查看完整内容

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是个什么东东?- t& h/ ]% c; u7 u
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* @9 w& X9 U, Z* k, F; D. U* M

. x7 ~! u. U: T- }& q7 BAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) H  ^" p; C; }$ [1 x; ^/ {& A0 F; P& F' L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# g* H1 i) r6 \  I1 `( \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ L  d' W: ~& P/ [# }& n' |
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 \& v/ }: C  F7 c* D8 F3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; a0 ~" D( t) n2 g* y0 Ubegin P_induction arriving/ p3 D4 k0 w, o$ r; [. @
    clone 1 load to P_pick(A_induct)
5 w1 Q( j8 }/ O! k4 Zend最大的系
6 J7 A5 k' [3 A. e+ s4 }/ `% N3 v+ {* v+ n/ W8 ]
begin P_pick arriving
* |3 R- e. x" t. E& m! i9 o$ M    set A_i to procindex * 10 + 1$ Q( v) @3 z% j0 s
    move into Q_induct(procindex)+ s. t5 f  U, n: G
    move into pickaisle.induct(procindex)
) L9 k, Y! ?  u: O2 a    /*check the type of pickaisle.induct(i), for your last problem.*/- K  N- o# m9 y- J( ^! [- g- ]

7 l1 ~7 _# D+ e5 k/ a; b    while A_i<=30 do begin
9 j" j7 _0 \; z# h4 n/ K        travel to pickaisle.con(A_i)
' Q) n& a! `% u  q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 G1 T- T: _& q6 v
        else wait for 10 sec1 o. U. ?& B& s( |( T& i
        if A_i=A_leave then send to die/ O6 Y+ w% P, s1 S. }$ K
        else inc A_i by 1
( t  J8 B2 F9 w) K, ~9 i    end5 O5 S, p7 w9 X2 y- Q2 F8 z6 v; h+ u/ g
end
+ D# J$ i# f4 l( j# M5 e$ r. R1 r: Z: Q$ T9 o
其中的procindex为整形,代表当前process的序号。+ H8 I+ g& K- M1 O2 ]
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-5-21 08:07 , Processed in 0.020800 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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