设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14184|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- _+ }, x6 K, x. L) i# S3 e0 |# z3 z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  a2 a1 Z) p) I* a3 _" Y/ c" r

, D$ z! O, _" B/ Y9 O8 cbegin P_read arriving. d$ \, t2 E* V9 e
    while 1=1 do begin
: U: S& r5 \# U        read A_tote from "data.txt" with delimiter "\n"6 ]& K" d( J4 L9 o' |
        read A_time from "data.txt" with delimiter "\n"! P) l, X* G- l: }, W  H4 Y
        read A_leave from "data.txt" with delimiter "\n"1 D7 v4 e" A9 c1 ~
        read A_picks from "data.txt" with delimiter "\n"
* ]/ ~; Y. y9 s2 B        set load type to A_tote# R. g+ l6 p4 P, A9 b) Z2 M
        if A_tote="tote 1" then set A_induct to 1& q7 v* `% ?3 b# G1 y
        else if A_tote="tote 2" then set A_induct to 26 ~' m4 N8 v( w' o3 a1 A& x
            else set A_induct to 3    $ M: A- R: j+ e$ W- Y, M: `% L7 U
        set A_i to 0% K: i+ R2 {: T5 X% N8 [! Z
        clone 1 load to P_induction
8 I) f5 q) {7 ?7 p* ^        wait for A_time sec
9 ~" R& ~5 @. {0 z* A7 o    end
- P6 z4 e! e( D& V" Cend
3 N( u4 F3 t) Z6 D
: F1 K: v/ U, p' t, E0 ybegin P_induction arriving
  K% O3 e& q% K/ n1 ^    if A_induct=1 then clone 1 load to P_pick1
0 X% Y- t5 [! ~$ U+ l: ?    else if A_induct=2 then clone 1 load to P_pick2
* N- @% U6 b! A# C" q7 [        else clone 1 load to P_pick30 f) I/ J3 S0 {3 k* e
end
/ e% d. O  _: E( B3 P) J3 C9 J' h
3 w5 }7 e+ r: e2 ^3 L/ q# U7 u( bbegin P_pick1 arriving. F, y: j3 D9 O+ T7 k% a/ V
    set A_i to 1
4 w/ B1 j( u8 l) O% E: U- n    move into Q_induct10 A  l6 q& t' q& C8 @
    move into pickaisle.induct1
- p. @0 \( o4 ]$ t. ?+ Y, l    while A_i<=30 do begin) X: `8 T: v, X( z3 T
        travel to pickaisle.con(A_i)0 i) Z) W/ b6 F& ^0 L$ E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 ^7 h5 i. _: y! F& ^        else wait for 10 sec
2 s8 r5 |( Q) Q! {; Y; `        if A_i=A_leave then send to die
; B/ L* n# I( Y* i1 a        else inc A_i by 1, u, A0 \+ v+ _0 W8 x0 Q
    end  ]5 N. E" M6 o2 V4 x
end' T* ?8 K+ e2 n, P4 Q2 H9 E# U
0 \% l$ s& X8 }7 ]: P
begin P_pick2 arriving; e- B* ~: P( h  }% m$ ~
    set A_i to 11
* A8 a3 y  X: u( b    move into Q_induct2, y" Y8 A& a6 X5 `
    move into pickaisle.induct26 B% \: N; B5 j3 c+ r$ E: S. `( `
    while A_i<=30 do begin
$ o/ m. C7 D8 \* [2 H$ n1 u2 u        travel to pickaisle.con(A_i)
7 c* E; ?  a3 V  [% @) \; V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 v/ D3 l4 @! y( }; @
        else wait for 10 sec
- U* F( L5 @- U% t# g        if A_i=A_leave then send to die
. D+ `" q+ T' w4 m2 Q# y5 Z8 v        else inc A_i by 14 ?; V$ n2 E& ~- s
    end& q& r3 F' d; j. U2 w: l
end
2 l; j( }" w0 z, I0 q8 L4 T" a; b: A  b3 @% q% a
begin P_pick3 arriving9 _1 t! ~) _5 q7 [& k( Y  k
    set A_i to 21- v' V3 m. G9 }( s+ \, W' E
    move into Q_induct3* A& o) Z: [. j6 t  F4 Z
    move into pickaisle.induct3, F$ M5 T3 q5 L) i
    while A_i<=30 do begin
4 @3 p" |8 z9 E: M        travel to pickaisle.con(A_i), z. T" g$ }# T6 O" \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 c8 K9 W- s  H" w5 g) Z        else wait for 10 sec% o. D. n' N" b' `& d( R: H9 d
        if A_i=A_leave then send to die9 [( M7 X9 G- k+ ?# `8 b
        else inc A_i by 1- ~: z7 j# S3 u2 _' a* K
    end
2 A& a" R' c- Nend

最佳答案

查看完整内容

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是个什么东东?9 y/ ]; f6 H2 p, a) M7 @' a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' c. G+ m( f/ u3 D" C& L! f; h4 f6 j) s% B( {
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& h; [3 M% a$ Z# @5 }3 s. r) ^, r: e' Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* p7 E# h9 J# J
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- ~* h2 r* Q4 O8 ]) g" c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 I* X4 D/ n0 x, Z  n$ K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 t) u# R0 Y8 D% E* P% n6 X' P0 mbegin P_induction arriving! n5 A3 m* Y9 f+ _) H
    clone 1 load to P_pick(A_induct)
0 I# w( Y3 F: H8 \5 F7 @% ]8 Xend最大的系
0 `8 v% P9 A) t, R+ h9 v* U6 A3 g4 h  {
begin P_pick arriving4 I$ s- x" k2 X5 S# m% w) S
    set A_i to procindex * 10 + 1  R& K& I3 L& ?
    move into Q_induct(procindex)! |  O( R+ }/ M
    move into pickaisle.induct(procindex)) ~" A9 J5 C( b7 t5 K; @6 [/ K
    /*check the type of pickaisle.induct(i), for your last problem.*/
! d9 |8 y* G9 a- g
/ B+ e) T/ p: A    while A_i<=30 do begin
+ i8 M2 A7 s# E, U        travel to pickaisle.con(A_i)
) x$ k1 W: G5 C7 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ {' A' s4 v% [; w: O
        else wait for 10 sec5 x; h' H6 |& G6 q3 w6 r
        if A_i=A_leave then send to die8 S5 d0 I: k6 w$ C
        else inc A_i by 1+ J4 D6 F3 p, X9 _" S
    end- k0 I8 _( l  Y' c! `$ r
end
" C+ @: x1 z/ S' v( J2 n
7 h6 y2 P( `- O. v0 W! T  c! q其中的procindex为整形,代表当前process的序号。
$ Y+ M/ }* E, N6 R2 ?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-6-18 04:06 , Processed in 0.016729 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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