设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11834|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" s5 k: _  X( R3 K' l: L1 I% z1 w: ~

5 M2 Q& o1 c) A7 T3 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中的数值,不知道会不会有什么不妥。
+ L! W" Y7 d6 V, a/ o
7 b* @9 c" N: J& w1 B, y* v5 ebegin P_read arriving) d9 h" s5 [. g% w& e) ?8 |" M
    while 1=1 do begin% c, z" _/ ^2 U7 B0 u
        read A_tote from "data.txt" with delimiter "\n"
& O! Q5 |- D$ P- D' w1 T        read A_time from "data.txt" with delimiter "\n"
1 K" X' K2 c( I# K        read A_leave from "data.txt" with delimiter "\n"" T3 @! N* K# y2 D/ u# L# d9 C
        read A_picks from "data.txt" with delimiter "\n"
% _9 {! I: A* s0 l* J$ o        set load type to A_tote
$ s- R% I4 f+ U% F* @        if A_tote="tote 1" then set A_induct to 1+ i0 f- u0 j- Y" J! T( `
        else if A_tote="tote 2" then set A_induct to 2/ N, ~+ b- W; q5 ]! ^6 W! @
            else set A_induct to 3    2 \: n7 F1 ^  S# M" m2 q4 N" Z
        set A_i to 0, B& q- T4 ]7 o
        clone 1 load to P_induction
7 R* |. u3 q, ?6 K  j5 P. y8 C        wait for A_time sec( o1 }* o, t6 X, x
    end; M( H- S# n; {& q
end
2 v* ?4 p6 T$ y6 S/ j- e0 O9 s0 a+ c9 i* K& F# d# c
begin P_induction arriving
/ Q) a1 [, x" Z, L" K+ X    if A_induct=1 then clone 1 load to P_pick1% w) R# L7 t% w& w
    else if A_induct=2 then clone 1 load to P_pick2
' B/ x0 B  e* O" T. F4 k" l        else clone 1 load to P_pick3
* Y& M8 ]% U/ Q% A  t% Cend
; R5 ], G9 q7 x( G( d1 W* z$ X+ ]6 z- {. S+ U' x
begin P_pick1 arriving) O5 q: ^4 \$ J: x% A8 \
    set A_i to 15 ~" d- E& A. u3 G. S4 b
    move into Q_induct1
8 q9 ^' _. Z' O9 ]) q) `: f    move into pickaisle.induct1
% `+ @/ t3 c- s' N6 H$ F    while A_i<=30 do begin
1 y! H/ h% V, z        travel to pickaisle.con(A_i), t+ X8 e* f9 @  P8 I7 c* `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  X& r8 I) F, r# b2 c        else wait for 10 sec8 j6 z/ q5 ?/ i) `3 t8 w( E6 _7 z
        if A_i=A_leave then send to die
4 @- t5 T: A" f7 F; w3 U; x        else inc A_i by 1
; C" @2 O0 a  [8 x  N- c% E) _    end
) f  R5 x+ o+ S# M  O9 Vend. u: Y/ a9 e0 ^7 i+ |4 y& w

2 C% G# q5 o! h& b: q2 ybegin P_pick2 arriving- a4 o6 t& V3 E
    set A_i to 11
$ |" _. ~0 b9 h    move into Q_induct2
3 Q0 B! J6 k( v* p    move into pickaisle.induct2
4 B$ [# a6 t! c    while A_i<=30 do begin
3 |0 [7 Q$ M4 i/ x4 p( p; B        travel to pickaisle.con(A_i)
; Q2 O: E. d& e, {; _: A: o) j2 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! ~, m; f8 r$ w& [* i: V
        else wait for 10 sec, ?- n3 F) Q" x% [
        if A_i=A_leave then send to die& m$ \7 e. o' e5 T0 ~2 [9 F
        else inc A_i by 1
7 R5 J* R/ F* z' O% ]    end: l% D" G5 I! [2 h+ u7 E' W
end
2 j8 e6 |& o# U& ~( f, p5 Q# Z7 q9 Q6 g- ~" `& ]0 I7 K% k) ]
begin P_pick3 arriving) A0 y# h- z+ O$ \( m0 ]0 m  ?( Q5 l
    set A_i to 21, @. @3 A* _3 |4 C8 q
    move into Q_induct3
0 R0 v  V: O3 t' f$ d    move into pickaisle.induct3
% L% M9 O  {  k+ {    while A_i<=30 do begin
; f" p2 n+ Q. l, R7 k. r        travel to pickaisle.con(A_i)
5 y. }8 z& t: p+ P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 F: b: p' I0 n( C7 W  s. Q$ ?' S
        else wait for 10 sec
: d7 [7 E2 W2 w. G' V        if A_i=A_leave then send to die0 I3 Y. B$ q8 ?; V% c; x' a
        else inc A_i by 1
1 U( z7 i9 @# n" H3 T    end+ }  a# v% [: q( t+ V+ X5 N
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是个什么东东?; D! R" u" N/ w! W4 V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ s& _1 P( Z& r  ?

- ^% H9 L" ~% ~  v! q8 M7 IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( s, c( |3 |" y& l1 m* I
% b+ I, s1 A  I0 J另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 q9 L5 G' j2 F3 e5 g- m7 ?5 |1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 d+ }4 q4 I9 y; r2 p) b  P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: R) x/ A' {- t0 O' N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 V/ C2 O' x+ e
begin P_induction arriving, Z0 G2 I. P" ^) I! H2 ]9 |: {9 J
    clone 1 load to P_pick(A_induct)
  t' j1 |6 Z' qend最大的系! Q- s. J+ u6 g! I" v( ?
5 ^6 X9 }' d7 `& g; @* [6 e6 |
begin P_pick arriving
! l: {9 P! F" J1 T    set A_i to procindex * 10 + 1! e! P. j+ S* K8 J% {
    move into Q_induct(procindex)2 h& a) e  h/ {" E; D. Y4 z) y! q% n4 M
    move into pickaisle.induct(procindex)
" h1 k% E8 _: g1 I, j    /*check the type of pickaisle.induct(i), for your last problem.*/# a/ m; A( o5 N, v; A
: }) n& C2 A; T# V# |. t' C
    while A_i<=30 do begin9 O9 X3 |: U* B. T
        travel to pickaisle.con(A_i)
) C9 r' t$ c( A+ {( L+ v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; F8 c5 j7 E1 Z3 F" j7 g
        else wait for 10 sec
* o5 o  D+ m0 F4 P2 \/ E        if A_i=A_leave then send to die" Z& {# q) v2 U3 f; T
        else inc A_i by 1' P8 ?( f& k$ M  J; e1 E! _, o
    end
6 t, f/ g1 P% |. S  \+ k  E9 X! Pend* G, P+ N# w- J
7 j% ~9 w5 t: P3 S& g3 [0 J% q
其中的procindex为整形,代表当前process的序号。
9 L& ~1 m/ w1 x1 }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-12-9 01:59 , Processed in 0.020313 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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