设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15573|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ B# R2 H. _+ p# ^0 `  o  y' j/ T1 r! ~% T' {- b1 _& N5 y* C9 w
我的问题是,在每个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* u& E! @8 u+ E' ^8 M* L4 w
% `3 ]  [" M( E& F7 hbegin P_read arriving+ ]0 t6 U7 v  S( H+ U" l  J: X
    while 1=1 do begin" o! v  }0 _2 J6 c3 b
        read A_tote from "data.txt" with delimiter "\n"3 }5 S) F) ]" h
        read A_time from "data.txt" with delimiter "\n"2 T  D) @* C+ N: a" G8 h; j% M
        read A_leave from "data.txt" with delimiter "\n"1 D& g8 h$ L: y% @- }
        read A_picks from "data.txt" with delimiter "\n"3 P- }8 e/ ^* h( M* T# f. q
        set load type to A_tote9 E9 h( w# F8 S/ C8 ?
        if A_tote="tote 1" then set A_induct to 1
0 u+ f; D% \. z$ A1 Q        else if A_tote="tote 2" then set A_induct to 28 o6 E; o0 F, A( [' T
            else set A_induct to 3   
: ]3 a5 X4 Q) j! e+ y" Z0 d        set A_i to 0  s  @  p; N# t: f5 p
        clone 1 load to P_induction
' R7 l- B' F' R8 H' V! N% d        wait for A_time sec
! H) X/ M" O( v$ N/ J5 T! [+ ^9 ~    end
3 N. P- b0 _3 O# [end
, A5 \) t% ]- N9 f# _" Z: M2 ?$ v- R
begin P_induction arriving
) q8 L. o7 p( }# G- z    if A_induct=1 then clone 1 load to P_pick19 ^& a! l' B% E- k' v" R
    else if A_induct=2 then clone 1 load to P_pick2% m1 \6 u5 Z+ U9 E! I3 O
        else clone 1 load to P_pick3
# i7 @( Y+ E3 H7 W( ^end' J* o+ t) E- ^. h3 U

% }/ O$ A2 A3 B5 E/ Q9 Zbegin P_pick1 arriving
+ w! o' F( x: r# E7 {# D; z    set A_i to 11 v) I& F6 }0 v. v! D
    move into Q_induct18 v4 ]& U4 ]; M4 T
    move into pickaisle.induct1! X- a) c; `. O% i, d
    while A_i<=30 do begin
) i9 I' ^8 n8 Y( _4 V        travel to pickaisle.con(A_i)  y- t' C) P9 ?' k  w- R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- i- h; @. U) f6 Z
        else wait for 10 sec
1 Z/ _7 R: J: u% E* ~        if A_i=A_leave then send to die! t. E1 X) s" e, b3 s" F% ]' u
        else inc A_i by 1
# s4 L6 g8 |* G; A* d; O* Q" h    end
3 e6 M  U5 J2 r0 v# _9 C% m$ Hend
( }  [& c! L8 g. L; K, B& c5 ]7 V2 B+ y4 j% [7 ?
begin P_pick2 arriving
9 ~$ L# j* x* l+ R% m* I6 s    set A_i to 116 V2 r: z7 E% B' n% L
    move into Q_induct23 N* D7 D- C0 k& i" k
    move into pickaisle.induct2
" `: n4 l0 ]6 M' O0 q) }) `' n$ Z    while A_i<=30 do begin" r2 h* M) u. l: I- ?. a: h
        travel to pickaisle.con(A_i), B" s0 ~. i5 E& i- p5 J# G; w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, E  y' n7 x4 |, _' q1 @0 Y
        else wait for 10 sec) Y0 v: u* h6 y. q+ i
        if A_i=A_leave then send to die5 g2 v' A4 `* ?% ^
        else inc A_i by 1; z' K1 K4 ^$ Y% G: l
    end- x' \* Z. T5 ?. w/ }
end
. L3 M. a7 V& f+ k  I$ f8 k# c; U) ~! k
begin P_pick3 arriving
0 @  B/ ~' t, C1 @5 T' b" F: y8 q' h    set A_i to 21. E$ q. q& y+ @. h: k
    move into Q_induct3; [, w7 t# `' P' U: P  E
    move into pickaisle.induct3- x, z/ X: }: X' P  _
    while A_i<=30 do begin
% S+ B( Q0 Q4 _$ r2 I5 T/ ~/ t% F8 [        travel to pickaisle.con(A_i)0 n9 b& j7 u" }' W- N3 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ W5 {# e; V+ H( C! e3 H
        else wait for 10 sec
: Q2 x1 Y- S0 }* f3 T        if A_i=A_leave then send to die
9 M2 A- \: j3 ^2 X; b9 E: J        else inc A_i by 13 l$ B9 h0 D1 C* @& |' X
    end& M) D+ r- S7 i# w$ R& j6 ^
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是个什么东东?
) s; N3 R& m% V: n8 r5 ?6 Cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; L( ?( T* b" n+ U0 E4 r' u7 D8 S  b- U, w4 j( i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 z7 c6 e# |4 D2 `; j  m

, L# L- n8 R/ b另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 I! B  A) G' w
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% Q% ~- P3 I8 o$ Z& S* j2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ g  ^* ]4 g  X
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ Q& _, r. k8 X6 v% j5 g, u
begin P_induction arriving" q, R8 d- C5 m2 ]
    clone 1 load to P_pick(A_induct)% V6 ?& G& J& K3 q9 h
end最大的系: o5 s& B( {! z$ E) X

( ?' z7 L: V+ Q  w$ d* }begin P_pick arriving
$ X1 O' E, E# e    set A_i to procindex * 10 + 1
7 Q5 _' z1 g. y    move into Q_induct(procindex)" C% ?2 M2 d' a. t* H: h
    move into pickaisle.induct(procindex)1 Z$ J  [8 T: ~) a6 L' z6 {
    /*check the type of pickaisle.induct(i), for your last problem.*/! O2 g  y+ V0 s  m3 Q1 Z

, `: F8 b8 O2 P* X4 P    while A_i<=30 do begin
, ?/ C+ b5 e( N8 E; R; _$ j- A        travel to pickaisle.con(A_i)
8 D) u6 H  Q- W; T7 P) b! A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- u$ E6 L" c. e/ n- j( d- J        else wait for 10 sec) J4 W- y" }5 R* `2 w
        if A_i=A_leave then send to die
& C9 q! E" Z3 U$ d$ L- k9 T        else inc A_i by 1
2 Y) O" k+ G2 E  @7 f* l    end
8 J/ Z8 J1 J; j- I4 I  K' n* J9 c" Hend
% p% n7 b$ s- c$ p" o" X% h
  ^9 v* }2 _6 Z其中的procindex为整形,代表当前process的序号。
. U, v, m& d) S% xstation和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-21 00:12 , Processed in 0.018724 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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