设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10665|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 Q# I- h6 {2 A+ G* |# n% ~
( E! \, U$ U8 E: O5 w( W
我的问题是,在每个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 R3 g- Z+ R4 C9 ~; [' k* m
; D- E2 b% j  Q, _; gbegin P_read arriving
6 R% r# d0 @4 F0 }" a, s* d/ N    while 1=1 do begin
3 B; ^" Z% J, f5 X/ W, t        read A_tote from "data.txt" with delimiter "\n"
( W9 E- `" x/ a& S9 }: M        read A_time from "data.txt" with delimiter "\n"1 N9 r9 w4 F( c( u1 }
        read A_leave from "data.txt" with delimiter "\n"+ t; C, h, G+ L" b
        read A_picks from "data.txt" with delimiter "\n"8 A+ M4 G, N+ K6 x
        set load type to A_tote, c- v* c4 l# ~
        if A_tote="tote 1" then set A_induct to 1# r  n0 X$ u( l# d' Z# @3 Q
        else if A_tote="tote 2" then set A_induct to 2
2 Y# F8 a; f- n) O, p4 m            else set A_induct to 3   
: Y/ _) ~  G( s0 r        set A_i to 0
$ A" M, Y; S$ B) Y        clone 1 load to P_induction; H/ Q0 n( u2 F2 H3 P
        wait for A_time sec
' F- j! f' _! ~5 {    end4 }* R: R- p1 x& z: c4 A& U: _
end: O' Z  |* H5 [) d! V. `: I
  Z6 }  h8 c) ^* m" `3 {
begin P_induction arriving9 |) \. ]. O9 z8 D  K* U0 U' C
    if A_induct=1 then clone 1 load to P_pick1
' K3 N1 Y# b( ?    else if A_induct=2 then clone 1 load to P_pick2
7 g' B& v* D5 A2 V        else clone 1 load to P_pick3; N, e* L! U' L, O) X
end
; n4 e/ c6 Y, W, L" q& C3 |+ o; {+ h% M
begin P_pick1 arriving
6 y0 t2 w, }- B8 f6 Z2 J; }    set A_i to 1  e5 }$ y' G, F& j
    move into Q_induct1: f$ X7 j& Y2 K- O" V% b8 e7 K
    move into pickaisle.induct1  [1 H4 [: T4 ~% l, b% A
    while A_i<=30 do begin' H) u9 G) }" W- M5 A( v: O
        travel to pickaisle.con(A_i)( G6 j+ b% O& U* t/ [9 X: v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( ]' y! I5 @+ e1 F7 @% x5 W        else wait for 10 sec
' ^8 F5 z! t/ k        if A_i=A_leave then send to die
) Z  C8 W$ \# w2 H  ~3 A( w        else inc A_i by 1% T) V0 a  T" \$ ?: u# x8 C# V; C
    end; o9 z$ T" J" ~& y: ?& G
end% B- j  A+ d" b$ \, u) {" l  I8 \
2 t4 [2 k1 x2 \6 A% k( X
begin P_pick2 arriving6 {9 u6 m+ K9 n+ C$ Z" |- P
    set A_i to 11' \5 i0 x8 O5 E% U
    move into Q_induct2
" @% z" U9 }* j    move into pickaisle.induct2, E5 b7 g0 k; {: E: ^- a$ B3 M
    while A_i<=30 do begin$ L+ U! x. Y6 }3 c% e
        travel to pickaisle.con(A_i)
9 m2 E: k6 N* D4 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 y3 @  E  K4 P9 m5 s
        else wait for 10 sec
8 k$ n! r4 D9 _9 j        if A_i=A_leave then send to die9 I3 X2 ]# c' z& \" T4 n0 d
        else inc A_i by 12 ]; o6 [& m9 m% F
    end* e( k/ A+ Q+ v8 F3 ?# g( S& w
end
+ ^& {" |+ _  x# m0 b/ ]7 ]1 |8 Q, j% N6 ~" }, @" C* o
begin P_pick3 arriving5 H  ^$ ^9 h4 e  t
    set A_i to 212 A- @/ H$ I1 b* I; R
    move into Q_induct3* t! l' \5 b3 V( B
    move into pickaisle.induct3
3 z; b" ^4 E& a# N9 D$ m* y    while A_i<=30 do begin
  O+ m  l; B) Z, l' w( B5 B        travel to pickaisle.con(A_i)
& h* Q$ E3 b/ N- Z5 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ U+ z. h5 j7 x/ l        else wait for 10 sec# x; Q8 F& F* H: ?
        if A_i=A_leave then send to die; R/ v' k$ F9 C# M5 }3 \; ]
        else inc A_i by 1
& Z, U0 k* O$ E! e6 f" X    end0 A' c9 ^) U" f) T! F$ Z) J
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是个什么东东?/ c: U  @* O; `8 `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! L3 |$ A4 E1 M* W
! e9 H, l# y0 Q* y; q2 I
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 G9 O! G2 z/ l: r
, x" b) ?' w; d( p' e  m: E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ i& s2 _4 F, b! Y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 L, B; C6 j1 T& ?, }- E2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 d- W4 t2 p$ r  j! _! m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. n7 p) M* U- e2 y- Y) j
begin P_induction arriving( W9 F, k2 h  w  y1 d4 C
    clone 1 load to P_pick(A_induct)
$ f: E% ^4 y3 vend最大的系& ~5 A+ H& q5 R: g' G& l8 w
9 z; n! ~  I: `
begin P_pick arriving
, f: U8 Q: j& m" }    set A_i to procindex * 10 + 1
3 f: @. A- {/ r8 t) u    move into Q_induct(procindex)
. k: L3 D! o2 V# Q    move into pickaisle.induct(procindex)
. h8 K+ c) u% ~& _8 A) F    /*check the type of pickaisle.induct(i), for your last problem.*/
# Q" e$ t; w; C# |0 U- b, N' z8 `& V: G/ E8 X6 J. L" i7 K" @( q
    while A_i<=30 do begin9 X6 l6 W3 r8 @3 k" U
        travel to pickaisle.con(A_i)
' L, b& x8 d: N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& n3 |% t! h8 Y2 B% [: ^
        else wait for 10 sec( {* E* L4 S) f( \$ b
        if A_i=A_leave then send to die9 l: {8 f% Y% G- {* f. k7 z- f
        else inc A_i by 1
5 T3 W& M# S5 V0 N) |    end
9 B, ~5 ?- I, R' {- T4 hend/ X$ H  i' f+ B/ F; C2 ?5 e

' }* y6 g5 Z2 @3 B3 d其中的procindex为整形,代表当前process的序号。, \: B. L9 M4 a5 Q6 Y( i
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, 2025-9-18 03:29 , Processed in 0.014382 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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