设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15391|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 Q" U' Q" c. P) R1 t

2 D# B. }: Q: V; v; [$ 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中的数值,不知道会不会有什么不妥。
/ i+ }6 S' W+ \% Q! c; P7 O
1 `8 h% ~* G, x& u/ W) Nbegin P_read arriving$ G" f% G2 x$ I; J) m6 F
    while 1=1 do begin
$ p7 q% V7 e+ l) [9 S        read A_tote from "data.txt" with delimiter "\n"* T* ?7 W$ h# ?8 o+ z. N
        read A_time from "data.txt" with delimiter "\n"
  f. ?) J" `! L+ H        read A_leave from "data.txt" with delimiter "\n"
! r5 F8 W8 Z5 I6 x/ k+ _: A: O$ G        read A_picks from "data.txt" with delimiter "\n"
1 ]# `& n! q6 C7 `  C# a4 X        set load type to A_tote4 s: m4 T  v( N9 b" u
        if A_tote="tote 1" then set A_induct to 1
$ G9 w: E8 Q. v0 U6 I        else if A_tote="tote 2" then set A_induct to 2
2 c7 u. b, h' N2 G: x  X/ Y# f$ m            else set A_induct to 3   
) s7 t2 G. H. V        set A_i to 0
/ V% X8 u4 h, O9 s6 G9 B4 u        clone 1 load to P_induction- v& q) z7 R, D7 N! H( i1 e& u
        wait for A_time sec
( f* S4 J% Z! ^' M& v  ^# b8 F    end7 N! @# l$ R. c8 C0 z! Q  O, A
end& M. V, b% z: s# i, i

4 y2 `# Z$ n  J( V$ f; a3 Wbegin P_induction arriving/ g, p8 x# ]0 F
    if A_induct=1 then clone 1 load to P_pick1
  Q2 Q( T8 I! E7 K7 D    else if A_induct=2 then clone 1 load to P_pick2
7 N1 }0 a6 {" \        else clone 1 load to P_pick33 c+ K0 d, z+ H4 ^- R2 }) B
end( \. W' D* [+ [+ H$ i: |
5 a5 V- \& `8 a/ }# p
begin P_pick1 arriving  ?! n1 L. E0 w  M2 X$ |
    set A_i to 1
6 Y0 s( ]. a4 @  Y/ [7 Q. y    move into Q_induct1
4 }# w- b$ P. a    move into pickaisle.induct1
3 _, j$ V3 T6 Y; V# T* T    while A_i<=30 do begin
  O3 ]4 z) B! I! R) x5 [        travel to pickaisle.con(A_i)
8 ^( T  p3 h7 _8 D. `. ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ^4 j+ [4 y; w- M* c  d. t
        else wait for 10 sec. h3 \1 P, [1 ]9 y7 r
        if A_i=A_leave then send to die
1 p0 s7 @6 z- c& b- t. @        else inc A_i by 1
8 C$ T9 \/ }* l0 S    end
! D' F" |% [# ]6 E$ k5 Iend
' K! ?$ Z# ~# {* P2 H: \# G; f* q8 Q) g% F% ^$ R; Z( X
begin P_pick2 arriving" Y& M# K' Z* |0 U: m" Z$ j3 a  a7 z
    set A_i to 11
: W0 {2 b2 ?! ]. k( h1 l    move into Q_induct2% O! p* }  t; `# o5 k4 g  B
    move into pickaisle.induct2
% i; }3 Y/ Q3 q0 |9 b    while A_i<=30 do begin: z" a" ^  p- O  u$ X0 h
        travel to pickaisle.con(A_i)6 I5 Q" D) m5 O1 s$ F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; o8 n* O, K* Y1 \+ o* I        else wait for 10 sec
( {, m, c4 v- F4 V5 X        if A_i=A_leave then send to die
& m& N( L0 `1 q7 Y        else inc A_i by 1, M6 W$ G: d, L' G1 b  ^* `
    end9 e( U5 R: |3 Q6 y
end9 d$ I- S9 l6 X0 h

. L4 o& v$ i* T9 W) X' N3 `begin P_pick3 arriving
8 k' I) t: J# C    set A_i to 21
- X; D# v& y; U+ ]" C& K    move into Q_induct3
. S; O% v* x; w6 o! i$ J3 m  J    move into pickaisle.induct3
, r* A0 z# r/ n5 |, h+ n0 B6 Y    while A_i<=30 do begin( _, t% q- F- V( R  z, Z9 M
        travel to pickaisle.con(A_i)
- B% r- i- x! w- C: Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 b. X4 W. P& `        else wait for 10 sec% E) }0 e2 k4 r% |. p( I8 `' B) M
        if A_i=A_leave then send to die
5 l  j. n9 s$ R3 _6 P$ C: c        else inc A_i by 1# \7 W2 L/ q" d8 W8 U
    end
- `0 ?2 C# i1 Q- Uend

最佳答案

查看完整内容

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是个什么东东?1 F$ ]" C" f2 x( c$ q1 i) \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& u) U1 y" q$ t
1 Y3 t, f7 q( q4 Z: W' ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。# D, C. V9 `7 D6 ]: K. u' w; E

7 S1 R, O! K0 v! W! z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 A% |' u0 }* G+ y1 w( X& g1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, |: q  J. _& I8 n& ?2 f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 t' O: f& X& _9 `, t( O3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" W# l, `+ K( c* p2 J
begin P_induction arriving
# T. L5 T" O) P9 J    clone 1 load to P_pick(A_induct)' ^0 {" m) E$ c" J
end最大的系! x/ G) D- v$ f& s; Q$ N7 o! x

7 B. J' I: }1 Q( s9 I8 O& E" Zbegin P_pick arriving5 C" t$ H6 F$ |) _, y
    set A_i to procindex * 10 + 1
2 ~; s6 d& k3 e* x    move into Q_induct(procindex)& K4 w/ H6 D, u5 N" ~
    move into pickaisle.induct(procindex)
7 @) y( v9 p1 ]    /*check the type of pickaisle.induct(i), for your last problem.*/, u5 @0 B2 F+ p4 }# Z# S* x7 y

& `4 g6 Z3 _/ ]* e: b    while A_i<=30 do begin
/ E# u3 x3 ~) f6 K        travel to pickaisle.con(A_i)0 |( v8 [1 o2 C& E  H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, B" F" K% C) Q* y) o        else wait for 10 sec& V. i: K) g3 h" S, ~
        if A_i=A_leave then send to die; E9 V. c) [* x9 b) o+ n
        else inc A_i by 1% [  E8 u5 K5 D; p1 @- f4 L" R% j2 c
    end
$ K& X0 ]) ~$ _9 U7 Gend' N8 `& _- d+ A0 c* d0 m

- T; r4 Q" e2 ^0 W7 s4 s其中的procindex为整形,代表当前process的序号。
/ j, L1 @& o9 s6 a/ C# hstation和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-8 08:35 , Processed in 0.016891 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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