设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12913|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 v: e  s6 {1 D$ s' x7 Z0 W8 Y' n6 I5 M# {5 q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# f8 y! W5 Z/ r; P/ v' \& j5 n+ x

& D6 h/ E0 `! h7 vbegin P_read arriving/ U# f3 P9 d% W6 j: s( `
    while 1=1 do begin
7 d0 H5 ]4 ?- I+ g7 G) V7 k1 ?        read A_tote from "data.txt" with delimiter "\n"' S1 J! i1 }9 Q/ ~
        read A_time from "data.txt" with delimiter "\n"
' C" t4 _9 F& f" _4 a: o9 a        read A_leave from "data.txt" with delimiter "\n"
; m3 R; t# L9 M3 d0 ?- `9 M. g        read A_picks from "data.txt" with delimiter "\n": `# A2 Q9 O9 ?7 [( M3 W$ C
        set load type to A_tote$ x  d" {/ {2 l6 q2 e+ d& d2 }
        if A_tote="tote 1" then set A_induct to 1' i4 [. m# r6 l  B
        else if A_tote="tote 2" then set A_induct to 2
( s( f0 G5 D0 H5 E1 S7 \# K            else set A_induct to 3    6 u1 {1 `4 F1 p- Y; @4 c6 J3 M
        set A_i to 0) Q* b. n9 N8 z% O, n
        clone 1 load to P_induction
# L! P1 U$ O1 ~5 c+ ~        wait for A_time sec
) i. X: p1 x- a& y6 i    end
4 D/ m6 S3 C" d: ]end8 X' L" r& d; B3 d, d

1 ^4 H2 ~% K( `& `begin P_induction arriving4 c, r3 [& F& ?3 Q; f& v1 }( i
    if A_induct=1 then clone 1 load to P_pick15 k3 t0 M" V5 c. N! Q2 z& B
    else if A_induct=2 then clone 1 load to P_pick2( |0 b6 ]  @- [1 E  N
        else clone 1 load to P_pick3
" _7 E5 _( i9 P; I2 w: i: Rend' {( M+ _1 P3 ?5 X+ Y+ P% d( e

, k& ], B( h4 @# u& t8 S" y7 _* abegin P_pick1 arriving# `# ~3 O6 B1 ^
    set A_i to 1
. M7 d- E2 l0 g1 P. b% z" N    move into Q_induct1# s& @7 W" m0 }$ F/ ]1 c0 H
    move into pickaisle.induct1
& C+ `+ d) t$ j- Z+ Z& Q    while A_i<=30 do begin5 L" r3 `' c1 T5 \+ h, S
        travel to pickaisle.con(A_i)  ]( B. b$ P: L/ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& W" B, ?# z' S9 C+ w  v
        else wait for 10 sec
" ~( }! _1 z. N0 }; Y+ y        if A_i=A_leave then send to die8 ?  j' }% O" z* _$ D8 b
        else inc A_i by 1
% E; A0 x5 |$ {/ N- n9 @    end
4 n# Y  [5 {: s9 O  p' F1 M3 `end2 j) i9 A5 \8 u

. k3 j5 {/ ^  [" s2 Zbegin P_pick2 arriving
8 q$ V; w; g* ~    set A_i to 11% v( R( f% T+ s5 A" U% N+ M
    move into Q_induct2
- S" M# M) d$ e+ G6 _/ j    move into pickaisle.induct28 P7 X" ?9 S1 ?" N
    while A_i<=30 do begin
/ [; f4 W( w/ t+ o) I0 ~        travel to pickaisle.con(A_i)
( [4 L1 R( B7 z! ?% G( D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 ~( {7 i" b6 s% m6 H8 Y8 C9 ?
        else wait for 10 sec
9 @+ |. G# |* t0 ~/ b7 C1 _' ?        if A_i=A_leave then send to die) a  s, t  B* @. s3 ~4 z
        else inc A_i by 1
! o* |4 \& Y3 K4 d& b4 u    end
! m! D( G! m1 Y3 e0 I/ s( m7 _- w7 Aend
! V+ I) i$ N* j7 i: i- f
3 X" x( E. D+ Fbegin P_pick3 arriving$ A) R3 |: [. u8 h7 l: o
    set A_i to 21
' j. D( e; X# a0 }    move into Q_induct3
" S- b8 X9 T7 s+ l  d9 |    move into pickaisle.induct3
; q9 |% j! t9 o8 k+ z- [8 N) k    while A_i<=30 do begin5 \: }: w% y  Z, Z! Z9 P
        travel to pickaisle.con(A_i)) ~. I2 b, a1 `' C% }* e3 Z. Q' b) J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 T: m1 J2 D5 W, o8 B+ m* m        else wait for 10 sec7 e$ z$ u2 ]) f  D* _
        if A_i=A_leave then send to die
6 A7 G" G& Y& |& W1 H        else inc A_i by 1
! U5 w  t( j, B8 d    end4 w9 z8 N% [. c  j' h) I# X, T
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是个什么东东?' v$ R: }0 q: T$ X4 Q5 U
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 ]% N8 q# J/ Y, \9 R% m) j# o/ y2 e
6 g: W2 ^' Z9 ]/ IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 K: W) _1 M8 Q$ ^- N4 a2 S! ]" I- M
! [+ q) d- K4 m4 j5 M: I, M
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) p# b' _2 f9 k
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 @0 p7 j  F" b9 @3 s
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: a6 a  T1 r4 r& q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 \* }. ?- h/ [( O$ mbegin P_induction arriving
+ @3 m( A' f7 e, \& C( s* i    clone 1 load to P_pick(A_induct)
: s- Y( E$ A: U, V6 w4 K* Hend最大的系3 b( v% D" R! E# D

1 |! C/ G1 O( P1 J! ?7 N9 g8 Sbegin P_pick arriving
$ ?+ l# B8 R5 o& E- N* p3 E    set A_i to procindex * 10 + 1
2 t$ v& H/ R3 G$ w+ U1 I4 @) Z    move into Q_induct(procindex); g% K# v3 d4 c2 B
    move into pickaisle.induct(procindex)
, e/ q0 P3 E4 Y, S8 E    /*check the type of pickaisle.induct(i), for your last problem.*/
5 x. j9 n" a& Q2 Q6 M5 V
- l8 ?, \5 a( a# y% W& \2 }  `, `    while A_i<=30 do begin
! U; _  D( Z% p; M/ T2 X4 ~        travel to pickaisle.con(A_i); t# w# y* ~$ d  c. a  o6 g' ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' Y  K5 C0 K) z        else wait for 10 sec
6 K1 A0 t6 b+ F5 i3 W3 U/ ^        if A_i=A_leave then send to die' f# D' [! j% U1 i" H# T- g% w7 z, t; m
        else inc A_i by 1
' b, h- B$ \7 P: m    end
( X' V# h/ x# y; p/ Send
6 n. Q% u2 Q4 X+ _4 c# k- Z# ]( b% S* a+ P, D* M, T+ |
其中的procindex为整形,代表当前process的序号。' i1 c! Q, e/ |. P1 j# M
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-3-2 12:11 , Processed in 0.016053 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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