设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14564|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 G4 S! r# D# \4 u" j0 c, ^- p. G6 T( V
我的问题是,在每个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, m3 V" \  d6 F) [
2 k$ N3 P& X& T1 D$ K2 b  V, Y, fbegin P_read arriving
9 B+ q; ?5 M4 t. i1 {    while 1=1 do begin
$ O* l1 F- H& `8 V        read A_tote from "data.txt" with delimiter "\n"- o* d$ X" [7 I9 t: w- D- Z
        read A_time from "data.txt" with delimiter "\n"
2 [9 @  k9 K) T        read A_leave from "data.txt" with delimiter "\n"( I7 n- w$ U& G: q' F7 E+ d
        read A_picks from "data.txt" with delimiter "\n"
; T! x8 I8 K0 C3 I3 x, @+ l" @        set load type to A_tote
  z- z( }' u  C' M        if A_tote="tote 1" then set A_induct to 1
+ u. \8 w! e* l& W' M6 T5 X, k        else if A_tote="tote 2" then set A_induct to 2% y9 D6 k3 s. A: [2 z
            else set A_induct to 3   
& h" l1 n9 V3 X' D7 }        set A_i to 02 [3 t  A1 W3 Y% _9 ?
        clone 1 load to P_induction
' z. B, `" S9 b        wait for A_time sec
; Z3 u( ]3 V) q; e1 ^" M8 j! ~    end
3 Q* q- l$ `+ `6 V& Iend
8 {. ~$ k& v& E0 ^6 G* P+ V- x
' g. i; ~4 K+ i, A! l* h/ F: Nbegin P_induction arriving: {6 F  D. l- L9 A4 a0 D
    if A_induct=1 then clone 1 load to P_pick12 z; B& m  u  ]' P, t  \- D9 g
    else if A_induct=2 then clone 1 load to P_pick2
8 m3 ]2 c2 L* i4 n0 V. u. _& B        else clone 1 load to P_pick3
. S0 f( q3 e& L! n( hend5 i5 ?4 e+ G1 O) }( V! ?9 ^
7 T* `) C+ W9 A; M7 i7 t- t
begin P_pick1 arriving
! R! L- ]: j. [) g: t2 z" j! H) k    set A_i to 1
* Y" S- s4 F! @( t    move into Q_induct1
" r# l- e. x# i+ O$ {, s    move into pickaisle.induct1$ m6 r! m; e' t. z' V2 O
    while A_i<=30 do begin5 o' t4 ?5 F, X* D( K: I
        travel to pickaisle.con(A_i)% B: A" N1 l$ |3 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ O: J, \8 P9 ]4 k9 Q7 C( |" G+ h        else wait for 10 sec! P$ P; R7 v) ]3 i( k
        if A_i=A_leave then send to die
% I. X0 s7 x7 X" \& [0 v4 f/ w( ]! C        else inc A_i by 17 \' s1 D. t9 M4 h% M, w
    end- k) ~( I/ T2 o, Y6 Y4 l% i" ?
end3 M6 `; I% Z2 j  M' R
! N8 R# G" |7 M* q$ r
begin P_pick2 arriving5 q  ?9 e/ f  G9 H/ g7 m* e/ N2 y
    set A_i to 11
, c4 L* R6 N- O    move into Q_induct2- u0 Z8 m9 z9 d" {4 x+ @
    move into pickaisle.induct27 z0 l0 `* T6 O0 Y9 j9 _  \# [. i" a
    while A_i<=30 do begin) P4 d! u* }) Q: ~
        travel to pickaisle.con(A_i)
7 a, O/ U; T6 N3 A1 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! f* c+ L: H9 ?  X        else wait for 10 sec
% l/ Z( r: x) Q1 h        if A_i=A_leave then send to die
: K0 T' h# l6 o3 K; [        else inc A_i by 1
* [/ w+ |  X1 o; v    end. \1 O& a7 a" h7 C9 e
end
7 y- L5 O# l7 x+ [; A& X0 C) k% I! q. y9 g, X% o* \! I: @
begin P_pick3 arriving
% t+ }4 S; h- h( P; ]; T+ I$ c' [    set A_i to 21
- a+ C% P, T( _    move into Q_induct37 R: K# d7 e- F; z6 U7 N8 Y# U
    move into pickaisle.induct3+ \  X- Q; W+ O" F7 C# ^2 r
    while A_i<=30 do begin* y, x6 u; @! x- \+ v' d
        travel to pickaisle.con(A_i)- N' o+ d6 u' r  T7 \2 J; H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 x: f9 p1 ^% J7 B1 S) g0 e  F4 H        else wait for 10 sec) X2 R6 I8 R/ i( }2 Y
        if A_i=A_leave then send to die
* l* N# E" p6 H+ c7 @+ X        else inc A_i by 1
( [& x3 p  k% ~2 ?% u+ N3 \    end
  V1 C7 p& B5 F. d6 Dend

最佳答案

查看完整内容

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是个什么东东?
/ {0 g4 b/ U0 w5 ^% g; tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' ]" K+ [: ^, m% P" \9 J: B1 X
. d: c) o+ J6 E2 @8 c3 ~% \  q( iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 f9 ]# X$ W; J

( S7 ~5 a5 w) X/ R3 T7 l, a- V& P另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 K% k- Y$ R5 I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' F& y& G& s8 g0 C2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 X2 C8 [, Z6 y  H- B2 z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 j0 }) x6 I+ j0 G! k
begin P_induction arriving
8 C0 G2 ?6 [% l; I+ y1 s- r    clone 1 load to P_pick(A_induct)
7 x% b  i7 f/ d2 U7 G$ \end最大的系+ d: t* J$ H# h1 L
. Y9 b  u& G: y. z( C
begin P_pick arriving
+ g! d! K- i) x* u$ M1 K& x; f    set A_i to procindex * 10 + 13 w, u# z& X4 z* i  s8 w
    move into Q_induct(procindex)! P8 m( d* `9 I* g& P# q
    move into pickaisle.induct(procindex)2 F9 o6 I3 g: G$ G5 n) n: f* |
    /*check the type of pickaisle.induct(i), for your last problem.*/: M& \/ q0 B+ }4 p$ e% F2 {3 h

: ]  G- C! z& k1 }: I4 ^, Y    while A_i<=30 do begin
2 @2 t* X) B: v2 b+ I        travel to pickaisle.con(A_i)
( s4 }4 {0 C9 q+ t2 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 S8 E% f/ ]9 u7 e& C
        else wait for 10 sec. u4 O8 ^7 n8 f# w
        if A_i=A_leave then send to die
$ q8 i- X$ p; M+ E( J        else inc A_i by 1
5 v& B; G: z1 @# Z9 d& G* Z    end
+ B( C# R1 n% g7 t# N" N( }end! i' m/ ~. p. P- y  w

% y# E4 _* V# r其中的procindex为整形,代表当前process的序号。9 j0 t6 q- D# P* Q
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-7-17 06:07 , Processed in 0.014814 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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