设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13305|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 y6 W' d# C( z( o& G5 g5 X
2 s) [3 |/ k2 K" C/ ?  ~& s# a* f
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 u5 ?8 L' t1 H1 H; C; j- }% ]: w- _- N- t+ g7 _) E' ^
begin P_read arriving
3 E; \; H7 m- f. j! t) r% Z    while 1=1 do begin1 v% A: \! {1 A5 q# F* M5 B
        read A_tote from "data.txt" with delimiter "\n"
2 [$ t; t$ r/ d( i; `        read A_time from "data.txt" with delimiter "\n"
. k8 B7 }5 x$ k/ ^* U5 _        read A_leave from "data.txt" with delimiter "\n"
4 f  m0 E- Q# ]- V        read A_picks from "data.txt" with delimiter "\n": t) t$ j' ]0 e2 C4 C) H  ?$ X( T  [
        set load type to A_tote0 ^/ W; j) X5 z* A2 B3 a
        if A_tote="tote 1" then set A_induct to 1* o7 B5 H& r6 P+ r$ l/ l3 I8 L
        else if A_tote="tote 2" then set A_induct to 2* O7 m; s; m2 j' X5 N
            else set A_induct to 3   
6 q6 k  R8 z: U2 l, E        set A_i to 0' }: r( c5 G7 p: a! C
        clone 1 load to P_induction
! c* J- \/ {7 E: j. B8 y        wait for A_time sec
0 u7 K6 y1 `- ]* x' f% ~7 _    end
; k3 w9 s/ E1 S" Rend- A" T' v% G3 ]. E
0 b# e( _* U$ n0 e' X
begin P_induction arriving
, V3 r  `( y2 R$ k3 l; ~0 A    if A_induct=1 then clone 1 load to P_pick1
5 S: B& x2 ]6 T& U' O    else if A_induct=2 then clone 1 load to P_pick2
; h: P3 A  d$ h) V7 _; q2 H% w4 u* c        else clone 1 load to P_pick39 W1 k; |! A# W  U+ x
end8 p" `6 \2 ^$ m9 J6 K1 |
/ ?, |+ J- S5 |- s
begin P_pick1 arriving9 }5 `/ G; S7 Y/ S
    set A_i to 1) Z( N  u3 \- }& f  b: k+ `# c
    move into Q_induct18 f8 w! v' A' ^) T1 Z8 E5 a
    move into pickaisle.induct1+ v! s: q# w) f. c; r4 c* _
    while A_i<=30 do begin
2 V6 J0 {' B5 G: d3 p        travel to pickaisle.con(A_i)
" b4 ^$ N1 u! z( x3 E  X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ?$ @& a5 W' ]- y8 J8 c4 @: K        else wait for 10 sec6 i- G; |& m& o8 H+ Q
        if A_i=A_leave then send to die) s. A+ I& F3 d( Q+ L8 A: M6 g: d
        else inc A_i by 1& g2 \7 v6 l) e- a0 ?* D$ \
    end! V/ v6 O% _$ a1 ?: B
end/ i2 p$ `) @4 X& J: L

0 @. I4 A; B; u+ `begin P_pick2 arriving8 m- f. |; s, m3 P3 J# D+ H6 |! k( x
    set A_i to 11( ]& p! Y2 I6 n4 w
    move into Q_induct2  u4 o$ g: v: \$ {/ }
    move into pickaisle.induct2
9 b% c/ x8 K+ s* b  `    while A_i<=30 do begin9 L3 g. F6 w( V- y
        travel to pickaisle.con(A_i)
/ `9 Y5 F4 e& n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 N) ]# D* t3 u" t: {" X        else wait for 10 sec
7 T* V3 x* B5 g( Y$ [2 ]        if A_i=A_leave then send to die  k' ]4 r& G, Y3 n3 S; ?
        else inc A_i by 13 M- c  V1 N: h  [+ ?1 n
    end/ x! L; u/ Y. g# L" w; Y( \1 m/ W
end
* L; z- a( `9 ?$ t; z* F& c# f1 q
' w* x8 b' L  _. u2 e- C/ pbegin P_pick3 arriving8 N  U6 r  K7 ?, }( o1 C
    set A_i to 21
' B9 e7 D. T: p0 b    move into Q_induct32 I9 h9 S2 y, U2 r! S7 m
    move into pickaisle.induct3& y+ q0 q; t% n5 b% a9 m/ q
    while A_i<=30 do begin8 i; @/ P6 X4 B
        travel to pickaisle.con(A_i)4 O) K( Y* n4 p6 X8 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. j2 m/ s1 y. S* p7 P; i$ U3 D9 H# M! J        else wait for 10 sec$ o7 w! T1 Q$ _1 O. g8 q8 ]9 c
        if A_i=A_leave then send to die$ k! Z& j. W* X$ K
        else inc A_i by 1- m" G' F7 q: e7 |  P$ l. c" B+ w
    end7 p* t8 R" T$ f1 q" c6 f
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是个什么东东?
( }, g7 [$ _4 E) T* W4 Pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( Y& Z$ g! R6 }* i
1 w: y0 W+ c% G$ {
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ @% M7 e/ p' |
! L0 m% N+ D& ^5 Q* r另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 M) {6 {5 h+ Z1 l7 \" U$ J
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& p  q4 ~# }, P/ B- n' ?
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ r0 D: Q) _# b8 u& ?- K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& B9 W* `- s. f: [2 q; w
begin P_induction arriving9 j# J1 u3 z; Q1 ?7 P% @( e: q
    clone 1 load to P_pick(A_induct)
8 Z, a# {; v; }end最大的系7 x1 S& S/ b. Z+ W6 d) Q

4 j- w  }) M) V$ \+ O" Ibegin P_pick arriving
" R  y: z# ?2 K) s3 Z    set A_i to procindex * 10 + 1
. d) p4 I( A! `) h1 X, B    move into Q_induct(procindex)0 r, P  j" K3 O" c% Z( Q; X$ o# k
    move into pickaisle.induct(procindex)
1 |/ y6 b( P$ b( f# U! p    /*check the type of pickaisle.induct(i), for your last problem.*/; q/ ^8 l! z; R  ^  m9 C
7 v6 o# B# e3 t( E! Z# X1 e
    while A_i<=30 do begin
$ j7 d# r+ W0 v& c- }+ S- f        travel to pickaisle.con(A_i)% `) U, q( S4 f6 W9 W; G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: |) l. \6 \3 ~0 P# b6 k6 W8 g        else wait for 10 sec$ z5 I$ i. C1 K. ]2 a9 `: A
        if A_i=A_leave then send to die& s! `: u1 p& @6 z
        else inc A_i by 1. i6 C8 F. l1 }6 n
    end
+ B. u8 n* m% o3 H7 ]end' y0 ^$ ~0 l) O3 h, [* U
! t5 u$ @% `; Z$ e, G1 G2 e
其中的procindex为整形,代表当前process的序号。
+ c: J" k* Z1 k: T/ Ystation和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-4-2 20:01 , Processed in 0.018765 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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