设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13027|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 k* I5 J& N: U" x* |! ]6 `7 y4 |
8 v) u9 N: a) \4 G' h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; q5 L% [" h* c  P7 ~* }  \
: F" _& Y5 `' r$ r+ u+ z% W0 j
begin P_read arriving! a; G8 J, }4 D& _
    while 1=1 do begin: ~- D, x0 W3 [% y0 ~* {% F! H/ C6 c
        read A_tote from "data.txt" with delimiter "\n"
: }: p0 m9 J. u+ {        read A_time from "data.txt" with delimiter "\n"  A0 w: o0 \) C; m, g
        read A_leave from "data.txt" with delimiter "\n"
9 l4 o" T' f& d; y        read A_picks from "data.txt" with delimiter "\n"
- z( e( K; Z4 N; r  F  ]        set load type to A_tote. J1 ?9 g8 ~; c
        if A_tote="tote 1" then set A_induct to 1- P! ?' q% S1 j) S0 y' I% o+ m, E
        else if A_tote="tote 2" then set A_induct to 2- ?/ M0 [; _" B7 L* x2 E& j: [! E
            else set A_induct to 3    8 ~' f+ @8 f4 }& X* o
        set A_i to 0
0 U# R3 X+ W3 _8 j        clone 1 load to P_induction; V6 U- E% a, s( D8 B" S
        wait for A_time sec
* M$ H: w( V! e( S: ~- F$ Y7 G    end) \% S4 U+ k. a# o, J8 g6 ]
end# k9 d8 k  H- Y, k9 H
. [1 d7 ?+ D- p
begin P_induction arriving) d; g7 f3 ^- x9 L
    if A_induct=1 then clone 1 load to P_pick1& @- t. v& @! L" B* O- k0 V  b6 R
    else if A_induct=2 then clone 1 load to P_pick2, I8 a$ _4 ^7 ^  ]$ _% E( v  d
        else clone 1 load to P_pick3
; z+ i  Q6 G8 _+ v& `9 H; wend
8 M% V! |, u1 n* `6 F$ `' F+ }( O7 C9 P5 X, ?3 @6 X
begin P_pick1 arriving
9 m* |- \7 p! e9 B1 C0 K    set A_i to 19 y* t/ @" ]. W- ~7 L& w- X
    move into Q_induct13 o' J. N0 _, }8 r
    move into pickaisle.induct1
4 y  Q3 `+ \6 a! V    while A_i<=30 do begin
( M0 }. G! c. b! A# g        travel to pickaisle.con(A_i)
/ U5 u. U3 i9 V- c) d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ w0 ~) J$ g+ H& ^" Z2 k4 b
        else wait for 10 sec
' `6 Y+ k% p, |$ t        if A_i=A_leave then send to die
- u. p  s# F2 _' j        else inc A_i by 1; P, S; N: l5 A
    end7 _% o: {+ m& x# S
end
/ T- L- Q: y% l! D% G: B6 Z; n0 a
- m5 V# r7 S7 g# b7 B4 Ubegin P_pick2 arriving- Y) S8 ~$ [& ~. @1 B9 t
    set A_i to 11
: m) l' B% ~  k$ V    move into Q_induct2$ @) e  R6 Y. T4 X- U$ {/ I
    move into pickaisle.induct2
. I$ ?2 _! z8 r5 F    while A_i<=30 do begin0 z* F4 R9 h; A5 \+ U3 Z7 |
        travel to pickaisle.con(A_i)
+ g. G) ^" i; v# C: l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# B# Y, x. i; G& z4 F! |. _        else wait for 10 sec
6 D+ g0 o) A) f1 L+ @& y: L6 b        if A_i=A_leave then send to die: O9 I2 k6 R2 u  D, ]4 A$ E
        else inc A_i by 1
3 X/ S5 I4 G! Z' @. p: T    end
# |, B7 d) [0 ~0 f8 hend2 z  s1 e# u# H) {2 [1 ]

0 t+ P3 R7 a: ]- Ybegin P_pick3 arriving
9 L+ D; G! h/ e! _3 R. m    set A_i to 217 s1 X+ w+ I0 B
    move into Q_induct3
6 V6 E( P- k, a* }    move into pickaisle.induct39 B7 [$ P& I) }' V/ N
    while A_i<=30 do begin
9 |; {9 \$ n4 Q  \( K: S7 D        travel to pickaisle.con(A_i)/ X* u& j0 F9 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 W: e. u0 A) v/ p        else wait for 10 sec
, x0 W: X' v9 u        if A_i=A_leave then send to die
0 S; O+ y7 M) ^        else inc A_i by 1
( `8 a9 y, t8 N1 Z/ ^    end
4 z! S8 d7 n" O- oend

最佳答案

查看完整内容

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 j  m* ], U# j" J
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% X* L5 M  ?; W/ ~' b
0 H0 x9 O+ O0 \8 L, F1 D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 w. V7 e. q: l- w) h# z
9 k" x! L; z: r) V
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) R: W! n# J0 j1 M* x: Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 z, Q0 N# J4 Q8 P4 R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 x! \0 A2 V8 K3 n7 s2 V
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. }& K  O& r" o% n5 Y- ?begin P_induction arriving
1 ~5 X  b1 {& _    clone 1 load to P_pick(A_induct)
$ F, N$ L- T5 R+ w( e0 Y, I* R7 d* K% zend最大的系0 A& z9 S0 n! A1 L" q

( s0 @: \% J% _5 T! rbegin P_pick arriving1 @2 \& D) U2 _- B" U
    set A_i to procindex * 10 + 1
$ v' N, e# L7 i+ y% V; ?2 e    move into Q_induct(procindex)/ w% A1 f4 e$ c% F
    move into pickaisle.induct(procindex)
$ e# @! d8 j. f$ u% N    /*check the type of pickaisle.induct(i), for your last problem.*/9 r" i  ~# x/ u9 v  U5 w0 v/ @# K
: k1 ~+ F( |; E4 d) P# Z! z
    while A_i<=30 do begin
: H( X7 J! o# P- o+ k4 G/ k        travel to pickaisle.con(A_i)
0 k( t! W8 z2 H. r* l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! {0 `; K; g& H. X$ `6 N) z        else wait for 10 sec3 l: N9 F# k4 }3 V) ]
        if A_i=A_leave then send to die
9 J/ E8 P0 |. J$ O1 H" O  A2 T        else inc A_i by 1
( e# ?9 @* _0 E) f' }. Q$ B    end, ]% }8 t: B. K. J! y& W; p
end
; n( H0 ~0 p( |- k9 u% q0 Z7 v, j3 Q' T# z3 O2 B+ V- N3 a; Q
其中的procindex为整形,代表当前process的序号。
2 r) z  O. m! u( ?- j# Istation和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-3-12 06:39 , Processed in 0.020972 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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