设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14438|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 P! G  F" ^% F; i- e% d; I) \9 ~3 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; v: ]/ r8 `4 r3 {/ U( H

4 w1 W1 F* \: u6 P  O. zbegin P_read arriving( y) W5 h+ D2 ^9 ]6 R0 Z) t# }
    while 1=1 do begin
( m6 F3 [. J$ v( l& f$ p. U; r4 p. p        read A_tote from "data.txt" with delimiter "\n"
8 W$ Q2 K! X- F/ K* y, v; P6 L$ o* [        read A_time from "data.txt" with delimiter "\n"
* v7 Q3 F6 o. `) r0 h) {        read A_leave from "data.txt" with delimiter "\n"
) ?) B! Q3 w3 D# p  u( K) Y        read A_picks from "data.txt" with delimiter "\n"* Z' n  O( f* U
        set load type to A_tote$ P2 y3 X- n4 \! p
        if A_tote="tote 1" then set A_induct to 1. Z" l6 g% W9 b# c; T
        else if A_tote="tote 2" then set A_induct to 2+ C9 X; V" f# U8 G
            else set A_induct to 3    , @2 A% s  X: T, |1 A. O
        set A_i to 0
3 q0 q( }: {" n9 W, D% t$ @        clone 1 load to P_induction
* }: E  H5 S" I7 N        wait for A_time sec- i9 s% K- L1 M: t
    end; ]) d2 t- P2 g, J
end
0 H; [7 k1 h5 N
$ c  Y) o" g- ^5 |) {% Ebegin P_induction arriving# T5 }. u7 S/ H1 x, x3 k. Y
    if A_induct=1 then clone 1 load to P_pick1% o  q- V8 [1 U, x7 x; `; R
    else if A_induct=2 then clone 1 load to P_pick2
; m/ K- X7 s( ]$ [& e- L        else clone 1 load to P_pick3
+ Z4 H# ~: Y2 y" g6 l8 e& Y# \end
3 k: Z2 d- Z5 J3 k7 O2 N! P7 r# H  g" e  s
begin P_pick1 arriving
& L! L$ D; z: H& F    set A_i to 1, i( C0 y% e% o; k( P
    move into Q_induct1  d6 |( G- R) y. S- [
    move into pickaisle.induct1" S( |  Z4 F& v
    while A_i<=30 do begin
% u. f2 c" [' R        travel to pickaisle.con(A_i)0 J$ ]8 m2 q1 u; P, @# J( O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; l8 n( m+ ~4 `6 ~        else wait for 10 sec1 g& W3 \+ p  x# X7 Q9 Z4 s6 r
        if A_i=A_leave then send to die  K: A# H4 R/ R
        else inc A_i by 1) z3 @* `: [* ^- S/ m& T, ~, F# a
    end
  f1 O) J5 e/ }+ zend
# ?- n# V* U' a0 s
4 d, A5 V6 ^2 H# h. [9 Z4 l) ]begin P_pick2 arriving
' T3 u4 ~) r  r8 w    set A_i to 11
# h$ q7 ?- G$ Y3 z* b2 r2 a    move into Q_induct20 L2 G( z9 F6 R2 r2 i
    move into pickaisle.induct2
5 R! n/ f2 E+ r2 i6 r" O/ \9 s/ p$ ~- r    while A_i<=30 do begin2 a& G% R" @+ t$ V9 v0 [# o
        travel to pickaisle.con(A_i)- c9 V- ]9 r& Y& Y- l- ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 E& n' t5 f; o3 X: R        else wait for 10 sec
% u7 t5 @. H1 n4 G% X        if A_i=A_leave then send to die& G/ a. E( G! e# a5 ]! N" r
        else inc A_i by 1
( V: n; `8 w, ~( b8 Z; M3 X    end& l- O/ u5 J. Q3 G
end5 L! Q. i) G( I- x+ L

; Q0 C. q( H1 \. P; ?begin P_pick3 arriving6 q: m# Z6 \2 O% x* |% m
    set A_i to 21  R" T1 V2 G* C
    move into Q_induct3
; X! [4 ]) L5 r9 ?9 A' m+ M( t    move into pickaisle.induct3
  r9 [  W$ N& x$ ]3 O    while A_i<=30 do begin  d3 f2 x1 A$ E3 g' a" [% @
        travel to pickaisle.con(A_i), W* E1 X1 N! l$ ^/ X3 B+ H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ?8 J7 L0 v# ?: ]8 v6 |        else wait for 10 sec
* D: v6 h% d/ t/ V        if A_i=A_leave then send to die0 P" K! ^& u/ }4 H0 Z
        else inc A_i by 1
+ a) ]* L2 d. u    end
8 r2 t( ~4 B; ]. Yend

最佳答案

查看完整内容

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是个什么东东?
7 ^1 z+ M6 I2 x7 p; ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& ?5 a1 P. W% w- x
2 V* D6 m3 Y/ I' W
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& u, z9 j( p% ^! T" r. |/ H% q

- i# _: e7 I4 W; C3 I: D3 Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ D: \% j9 U" S; g, G  J: W. j8 J6 F1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# w8 j' g% q$ ^
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; [8 {5 S! V" T, J6 \
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ m, _) W3 i5 x
begin P_induction arriving& J1 m/ d* W  r5 G5 ]7 }: R
    clone 1 load to P_pick(A_induct)& x4 H0 p2 S, \  p2 s3 u5 m0 B0 E
end最大的系
3 `. C$ y( Y; H5 u" q( T9 M; t9 ^
begin P_pick arriving0 J9 M* i4 Q" r+ Q
    set A_i to procindex * 10 + 1$ ^  o, s8 a( s1 {
    move into Q_induct(procindex)
) g, T9 V, N& V  H( c    move into pickaisle.induct(procindex)
( G; |, d3 q: o    /*check the type of pickaisle.induct(i), for your last problem.*/
+ @8 I( R3 B7 i5 a% T6 X1 K
# d) P+ a% o* C  h0 u- \1 n    while A_i<=30 do begin) C( X) D6 _/ \" `/ _) J: h5 w* D
        travel to pickaisle.con(A_i)7 _+ e" {8 _$ q& m" O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* K+ x, E* K# R' n4 `2 G
        else wait for 10 sec
+ m0 z  o# p1 a: j4 ^. g, n        if A_i=A_leave then send to die, G0 L& _" k) y4 g- o# a
        else inc A_i by 1
/ H' A4 S5 Q5 S( o5 f; j8 J* Y    end: ?; D/ t2 b5 K5 G6 H8 U5 ]* W  _
end
% o  W( p1 H' r$ V) g( [4 V0 d  P1 s  a, R5 d( [, Q$ Z8 T7 x% c
其中的procindex为整形,代表当前process的序号。
: [% O; [7 Y0 G8 P5 o4 V4 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-7-11 12:18 , Processed in 0.013819 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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