设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12836|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 w3 K/ m0 D) V8 z  K. w
: H% w0 J! w5 Z& e5 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ J2 P9 b2 \$ [: H- u5 G

2 W  S/ {/ d+ l! [  R! {9 @, f* Abegin P_read arriving# F/ @/ N: L' b9 P; t
    while 1=1 do begin1 u% P( [. C2 G/ ]
        read A_tote from "data.txt" with delimiter "\n", X7 b# l. R% _3 L- w
        read A_time from "data.txt" with delimiter "\n"& O/ w; D! I6 }) J
        read A_leave from "data.txt" with delimiter "\n"/ N' ?6 h+ m; M0 a9 l  d
        read A_picks from "data.txt" with delimiter "\n"
' y3 m2 g. J; K6 `  f! t        set load type to A_tote
, K, R7 o. t- t( e. D7 U        if A_tote="tote 1" then set A_induct to 1: y, Y  s7 {4 D5 R, ]- Z8 l; m& ^; F+ ]
        else if A_tote="tote 2" then set A_induct to 2
! {8 a( l  J; {7 a            else set A_induct to 3   
8 W' g/ H/ b) ?( v: M' @; j8 O        set A_i to 09 A) F0 _9 G- ^& V0 v6 W6 _" G& {& [
        clone 1 load to P_induction& N7 H/ R2 D/ l8 B1 e
        wait for A_time sec0 z* @, r8 {, o% m2 m6 Z
    end
% i" U# g, I: X2 j1 uend! L, {' t9 S5 _' g. M
* z* k# V3 ^7 e, c
begin P_induction arriving
) W1 e* }$ c! Q    if A_induct=1 then clone 1 load to P_pick1
6 y; c+ E3 j: N2 U) L( Q    else if A_induct=2 then clone 1 load to P_pick2' h7 P. @1 g) D
        else clone 1 load to P_pick3
. I/ Z* o& Y. n/ _9 ^8 A& Pend8 J8 Q7 i" o: Z  Z0 J
5 g1 y' P( {/ W3 I/ \$ x
begin P_pick1 arriving9 r& V# ]# [! x: j7 n% u3 R1 Y* H
    set A_i to 1* p4 @! }/ u0 L& c6 g8 ~
    move into Q_induct1
. x5 z6 L8 c# d" _# r: q    move into pickaisle.induct18 ]# Q6 ^8 X6 V  M/ w
    while A_i<=30 do begin
) D  ?0 J$ L) @. a1 c5 q! R, J- V        travel to pickaisle.con(A_i)" p7 s% ]* C1 X$ m& a  {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- f1 W- A' k+ ]2 D# c8 H. w        else wait for 10 sec
1 h. E' ?8 }) y* \& e4 d/ y        if A_i=A_leave then send to die
; j- d" x; F7 c3 M$ _        else inc A_i by 1$ E0 ^% J$ ]' r6 D
    end
4 r  G- H+ A! B1 |" X8 F; yend% ?) N$ @% ^! l& ?+ f2 C$ }

3 f$ t. q' I8 z+ C; ~begin P_pick2 arriving
9 z/ v& D; K6 f- c6 E& N    set A_i to 119 y( b& Y4 m6 K, Y& Z" r+ n
    move into Q_induct2
" q; c; Q3 T6 G, S; m# ?1 u) H- F1 U    move into pickaisle.induct2& ?2 _. [/ `) H. J: u
    while A_i<=30 do begin, i8 P6 L+ k: f2 X$ F; i
        travel to pickaisle.con(A_i); e6 O5 s7 W' d5 p- \0 n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 y2 z" _* ?1 m, d: u, i1 a        else wait for 10 sec7 g1 M1 A1 y% ]9 o
        if A_i=A_leave then send to die
1 D: J: R8 D1 ?8 V; }        else inc A_i by 17 a: r& e# Q4 b1 D7 m
    end9 X" X* |1 x, I0 E4 z$ E3 N
end! ~% X7 P. G) y6 f9 h1 g% |
5 C& a3 s9 o( c3 H8 L
begin P_pick3 arriving6 a' P$ p" F8 o6 F) m4 u, l  m: t
    set A_i to 217 Z; H+ U8 R1 c! z$ ?% t  G9 ~1 H
    move into Q_induct3
+ P+ ~5 j& |5 O/ r2 ]    move into pickaisle.induct3
/ y! {! o) ?9 Y" x8 [, b, `    while A_i<=30 do begin9 R5 ]3 @, ]) R0 ?; u6 _2 t
        travel to pickaisle.con(A_i)' ?5 O6 H! I4 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( s( I9 w: E6 `! D2 t- E
        else wait for 10 sec
  X9 x; W6 k7 Z  e        if A_i=A_leave then send to die# T/ T) Z  {+ P7 Z" H
        else inc A_i by 1; K" F' x; }1 [- ~. n' j) D: t
    end3 y6 X' l* V8 W" J; s# `
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是个什么东东?4 L. D# F% m! K+ C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 _3 X- x  O& [: s- m) k$ ?, i# ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ ^3 ~, \) c* X* u
! ]) h2 `% f- N0 g7 v. \6 P/ F
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 c1 C( s& q  z  U8 ]+ @$ g3 h1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( ^1 r5 m& _& m& d. A2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' Y  @# R) b- _! u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* [6 l" e; z. y) T3 x  Z
begin P_induction arriving
4 z1 I$ j: i( k+ n    clone 1 load to P_pick(A_induct)
% a9 H# ~8 s% O: r! p; k; rend最大的系
( W) g4 C* ]& y' z0 R& j- U, ~
begin P_pick arriving
# m. m" f0 x! l* L9 k& a/ Z    set A_i to procindex * 10 + 1
6 ^* f  o/ H/ e* F' A    move into Q_induct(procindex); l+ g7 g$ T1 B+ N- `2 j; Q
    move into pickaisle.induct(procindex): x* H; u$ `0 q/ F4 y9 n$ k
    /*check the type of pickaisle.induct(i), for your last problem.*/
) X! H+ l: E/ |3 b6 f6 h9 t* F& F# M' r* Q
    while A_i<=30 do begin
6 A& `! i# O! s& I4 g        travel to pickaisle.con(A_i)
5 F$ X3 \1 p1 I5 G4 C/ W; D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ U5 o5 \% v9 z: C2 Q$ W) W+ {        else wait for 10 sec
) Q! z9 A- E& e( ~# [6 k& j$ [        if A_i=A_leave then send to die& ~0 l1 a8 @4 ?* G- t) g- r$ [
        else inc A_i by 1
0 Y3 x2 n0 V  S/ r& O& a/ b9 W    end
/ r" ?1 b$ L. {. V, G7 f7 Kend! {4 q7 s  }2 u; g1 h  {5 m1 c* d8 J

+ I: T+ n: f0 `- B% T其中的procindex为整形,代表当前process的序号。
, A+ Q3 r5 T- [( q/ Wstation和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-2-23 12:55 , Processed in 0.017632 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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