设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12450|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 N. A/ h; z& b% c7 p$ f, S5 o
1 ?' ?! ^2 _' r5 |5 N% L2 y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% R* M4 s- L* I4 i+ R5 A
- z4 {8 g+ h! m) [* T7 m9 rbegin P_read arriving
" ~& }1 V: |8 a2 B. r4 d  G    while 1=1 do begin7 F7 z: ~/ u0 r7 f1 r8 ^# }# b
        read A_tote from "data.txt" with delimiter "\n"
2 E3 P8 |6 \9 s: U3 v, O: ]        read A_time from "data.txt" with delimiter "\n"" m5 s4 c% J1 P' F* b$ e
        read A_leave from "data.txt" with delimiter "\n"
  B) T9 |2 B1 i% `! \% j* ^        read A_picks from "data.txt" with delimiter "\n"" K0 L. _* A- J8 V% F
        set load type to A_tote5 l, k! `/ q$ l' a7 {- |( t! F/ R
        if A_tote="tote 1" then set A_induct to 1
3 t8 t  ?4 H1 s/ K2 N2 J; V- N        else if A_tote="tote 2" then set A_induct to 28 ^/ s( C" B- N3 P8 ?  I" m3 L7 w
            else set A_induct to 3    6 {5 \. `; U2 {' c* J! G7 e* G1 [, z
        set A_i to 0
. Y+ X& {! @, q- N) B" N        clone 1 load to P_induction- V, I% `, p0 N
        wait for A_time sec
; b5 D( {  O6 n  z7 F    end" i2 t% d; `$ k" |
end
$ k6 @- b5 N& l8 ?6 p
2 o: Y3 ?8 w: X$ Vbegin P_induction arriving
# N1 L$ O* J' u, |; ~0 c9 W    if A_induct=1 then clone 1 load to P_pick1
% ]1 g+ F! [% @4 U    else if A_induct=2 then clone 1 load to P_pick26 k; w  d3 P8 h5 t+ F8 K) Y: R
        else clone 1 load to P_pick3* q, f; {. |0 Q  }( G# G0 d
end
* z6 A2 U: o3 X2 X* a* {
7 ^% I& F, M* nbegin P_pick1 arriving
8 s, Y: y; `8 R+ \. o( p    set A_i to 1- G- G- o8 h7 J+ t
    move into Q_induct16 ?$ d' U8 ~; c
    move into pickaisle.induct1
: z$ J1 Z( L1 e! T  J    while A_i<=30 do begin
2 _0 c4 n& B& }, a8 k' G        travel to pickaisle.con(A_i)" j* U; D9 s( M+ _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 y% }( v/ ~* h9 z; ?        else wait for 10 sec
6 N& ~% Y& |0 s; @( \- `        if A_i=A_leave then send to die8 w: C2 _8 g9 ^9 d2 K* r! r
        else inc A_i by 1% N' ~) A) I$ ^1 v$ ?
    end
0 ?& ^- [) {8 @* ?; a( Fend
5 I, [& L: B4 d6 ]9 ^4 w
9 [: f% ]" _, b9 qbegin P_pick2 arriving
3 b/ E1 |3 q/ n+ d; P6 w: j    set A_i to 118 H5 k. d" q( u1 [8 b
    move into Q_induct2
* U+ d4 l7 o2 p4 Y' d4 T    move into pickaisle.induct2
; c8 s( Q& V" c# `! Z2 {    while A_i<=30 do begin7 @) s1 @1 P. u+ n( Q
        travel to pickaisle.con(A_i)
* N9 h5 y5 I: i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  o( v9 {1 Q# O9 ]7 d$ t7 r5 F
        else wait for 10 sec
6 r; s& k0 [. a        if A_i=A_leave then send to die
$ G1 l; H4 s4 n        else inc A_i by 1
7 k! O0 F/ L/ T* b  |6 U, K    end1 w& x9 B! D0 }  f' t
end
) Q4 K2 t, O7 C& b! l5 z, c
, ?& }7 {3 O$ ]# [begin P_pick3 arriving. w' e- \( |! W& `
    set A_i to 21
% c% D/ u% u- ]2 n' Y1 Z+ u5 B    move into Q_induct3* g" E9 B9 p& M% R4 G5 p
    move into pickaisle.induct3+ o' T) r3 N- ?: W
    while A_i<=30 do begin) J" j! K# ^% H
        travel to pickaisle.con(A_i)
& G0 |' `! t1 |( R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 V$ C! c. N3 m  f+ t        else wait for 10 sec  f  }' l: n$ u. B" `
        if A_i=A_leave then send to die
1 b" ~3 a6 U1 Z! W        else inc A_i by 1; x) r9 i- [5 w8 B# i
    end
" R$ h* W% u0 d" R- t& n1 tend

最佳答案

查看完整内容

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是个什么东东?* s! q2 B, O8 R, J) r& i4 Y$ `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 t! |! ?# G- ~( Q) Y, I

$ g$ w) z$ |9 l$ i3 Q# k, _* dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* m4 ?9 m$ K9 O
+ R: s$ |8 }8 R另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; v& |/ f: A& q2 |' _) x8 b- }1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 c+ g% k" E% j* Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) e5 |4 g; M" x0 f7 R6 j
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ K2 b7 W2 K/ d0 M7 o$ P
begin P_induction arriving7 ?+ j2 ~) M. H) w) ~1 x' t  I
    clone 1 load to P_pick(A_induct)
+ P9 J" _3 S) K$ [end最大的系' i: _* h+ D& `$ {+ @" t1 U
/ J' M: I6 p0 i) }4 [
begin P_pick arriving8 q% B; M, p: H& P$ Z
    set A_i to procindex * 10 + 1
) N9 g4 E0 t0 |1 m/ N- W5 {2 ?    move into Q_induct(procindex)! q; a3 y9 y. D
    move into pickaisle.induct(procindex)/ h" N9 _; x* o; U
    /*check the type of pickaisle.induct(i), for your last problem.*/
" _- v5 P$ {  s8 l0 T6 x8 r. Y/ B/ d0 ~+ O
    while A_i<=30 do begin6 U4 ^: K( m# r4 n* L! @
        travel to pickaisle.con(A_i)
5 d3 V) U0 }. A5 m2 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 s' T6 T- ?7 Q" L# V
        else wait for 10 sec
! {* F: j4 V# u# ]5 N        if A_i=A_leave then send to die) N. }7 t- }/ A$ s, O6 H1 a+ g3 H
        else inc A_i by 1# U( D; n0 \/ m: a+ @$ }) }
    end$ G- K4 k; ?6 C- a1 ]8 k6 f
end
+ z+ B& S, p# n8 _
: {3 z/ e/ L% ]1 o) t. a' q1 V其中的procindex为整形,代表当前process的序号。6 u% O. L2 a; d9 g
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-1-24 18:52 , Processed in 0.016473 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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