设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15476|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 |4 I+ z" u/ ]/ X: i" i$ e7 ~- }
+ }; k% t! v" [% P  X$ z2 t1 K我的问题是,在每个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 g: H; o$ B0 `7 m/ v" Y. ?# b
  G* z, a4 K( v0 I
begin P_read arriving, e+ V4 e$ F4 h' M- n: @' |; i) Y
    while 1=1 do begin" |& D' R, X; y
        read A_tote from "data.txt" with delimiter "\n"
8 l$ j$ e3 W$ L; d        read A_time from "data.txt" with delimiter "\n"
2 u4 {( P& L/ v' @9 |) J        read A_leave from "data.txt" with delimiter "\n"
) a: F' {, ]. o5 u        read A_picks from "data.txt" with delimiter "\n"
, x3 V* U8 O2 f  X( w9 }        set load type to A_tote
* t6 h4 B$ I% @) H3 V        if A_tote="tote 1" then set A_induct to 1
2 x2 P7 O0 L. I) i- h; ^4 l) Q) q        else if A_tote="tote 2" then set A_induct to 2
3 t) R! ]. g0 p1 r9 X" O            else set A_induct to 3    5 }# a4 L. W* S8 r' q. W
        set A_i to 0
1 u9 g- f" J4 ], N% t4 h! s/ K0 m        clone 1 load to P_induction
9 R+ @2 [8 k2 X+ O& s! u, Q1 {* _        wait for A_time sec
8 Q0 s7 z- W4 Z$ C6 }    end* b* \4 t! Z" C, L
end' ]3 {/ C4 h4 i( [5 U

3 t( ~2 ]  Y7 h# L4 \+ ^, Cbegin P_induction arriving4 D' P& x* H: F2 y! |
    if A_induct=1 then clone 1 load to P_pick1
3 B' ?9 y) J' u1 y8 D    else if A_induct=2 then clone 1 load to P_pick2" p) s2 c4 k6 |9 n+ d
        else clone 1 load to P_pick3. c. S6 P8 i( u. o6 X3 p- ~
end5 G) S- P. o3 J& c! P
$ m$ d( l- e- q0 q) X1 }7 p& o/ t1 n
begin P_pick1 arriving
) a1 v' N, p9 D% y' y    set A_i to 1$ F, D  y1 g# R0 L2 }
    move into Q_induct1: V6 v- z5 P7 ~8 k# t5 |4 ~. i
    move into pickaisle.induct1: k3 d0 X5 W. `
    while A_i<=30 do begin
- m% `- J% }+ s        travel to pickaisle.con(A_i)
) C; @8 Q3 A" J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" |7 o0 S: B! D
        else wait for 10 sec. }% k5 @  j+ a# H
        if A_i=A_leave then send to die3 _" p9 K3 V/ Z
        else inc A_i by 1) `* s- ?/ Z  {% Y' o% b
    end
3 B6 j+ J) _/ ?2 @0 W! rend9 v5 @1 P* J7 h: B

7 e. ^7 C) b2 O& ?, ^begin P_pick2 arriving
7 j4 O! n! n! M& X- t. `    set A_i to 11
5 R! \. M" K$ t. k    move into Q_induct2+ |5 M: t* F' p, d9 V
    move into pickaisle.induct2  Q2 m. U  C6 e4 z5 }
    while A_i<=30 do begin/ j  u4 L/ {& T5 V$ a8 }* P4 V
        travel to pickaisle.con(A_i)
% Q) ?# v) S, ]/ [6 h- R& Y5 X* h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ c2 ]" I. L8 S% W3 R3 R2 F
        else wait for 10 sec$ F! l6 ~3 Q3 T) f. {1 h/ C8 W$ ^
        if A_i=A_leave then send to die8 I3 J  @- W: F$ \
        else inc A_i by 1( a9 s! z+ ~, h/ [
    end
8 K4 u' I8 y9 Fend9 F* W; a% O% K2 _9 R5 Q# N

, Q% A( P$ y- G! D. J4 u+ |begin P_pick3 arriving! |* J3 \* i& X5 t
    set A_i to 216 o% `- \+ U( `
    move into Q_induct3
% L) d  F6 o: d2 O    move into pickaisle.induct3
& i6 r( |  Y+ \2 l: k$ S" v) ~    while A_i<=30 do begin
( u& \0 Q& G5 X- E( |  u& M9 X        travel to pickaisle.con(A_i)
( n2 `$ M7 e/ {. z3 z" b7 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 x  V0 s- Q7 g2 S$ r: V% n% ^4 _        else wait for 10 sec- P6 R. r6 c9 v- Y
        if A_i=A_leave then send to die0 I% D6 C; K2 i1 l# o/ b
        else inc A_i by 1
) f% s3 U, N) Y% m- ]7 m    end
5 O& n' X6 W; j3 }* I& ]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是个什么东东?
5 q' G' w: `4 K3 B4 D3 C8 Cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% r4 u$ ]* k) F/ R: R7 f, C" q

7 B% s$ v6 B+ A' vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% \5 e. ]$ y# u5 Y

4 ~- v6 W) v* }/ l% ]另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 Z8 x# r+ P! R1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 K1 }- e- b+ M, o$ C
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 Q" I/ e# {- _/ o1 N% S1 ]; U  ^3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 _( w5 b  y, h+ p6 `, D9 x# H
begin P_induction arriving+ p2 x+ A# R8 @- }0 }
    clone 1 load to P_pick(A_induct)9 ~/ {  T& s" R+ ~& k( e
end最大的系
% A6 b) \, ^" S! ?, @2 C* O# \% f9 r7 }" M5 @
begin P_pick arriving
) z/ [* d3 T+ H' W    set A_i to procindex * 10 + 1
$ z, g7 T8 r( Z7 k2 d" A    move into Q_induct(procindex)
# `# |3 H+ D" f* B" g3 G    move into pickaisle.induct(procindex)7 V0 K  D8 F% n& [/ k; [
    /*check the type of pickaisle.induct(i), for your last problem.*/9 C3 ^% p" v2 s+ d7 \: {
* X% W/ t! @+ R/ H2 {* j% @
    while A_i<=30 do begin# \. b8 L4 g7 w, D
        travel to pickaisle.con(A_i)
/ M$ o3 H# C/ F  }- y/ \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ M) G4 [1 ?7 R$ I& g        else wait for 10 sec7 q. V5 J- R7 ?8 G; _+ U
        if A_i=A_leave then send to die
9 s2 ^9 @6 ?/ r( n6 _) Q        else inc A_i by 1
) }0 x& D9 [: T$ O, |- j1 z( S    end5 s. V! B& Z) \8 C
end
. F% Z+ ?7 y& y0 q' W; h/ e$ g& n; {0 S' {* M4 s
其中的procindex为整形,代表当前process的序号。
3 Q$ D& j8 j* |0 ]" cstation和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-9-13 14:07 , Processed in 0.013358 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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