设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12488|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* c3 l1 e$ C) D4 P( F# `& T( G9 H  u8 t  A3 i5 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中的数值,不知道会不会有什么不妥。  i/ v) O' c1 R+ o
, H  y7 R8 ^* f3 g. z& O8 ~
begin P_read arriving
& i9 n6 X( o, u1 Y5 G# C5 A    while 1=1 do begin- ?- Z& K9 ~5 y' P# s
        read A_tote from "data.txt" with delimiter "\n"
+ `& Y& z/ Q) [8 A2 v3 Q7 f' j        read A_time from "data.txt" with delimiter "\n"
' I# p1 t! p% c$ c% N4 ^( G6 A4 D( z        read A_leave from "data.txt" with delimiter "\n"
+ a8 w3 l& Q/ R4 z4 [3 T        read A_picks from "data.txt" with delimiter "\n"
# J; E; L. x! g$ d$ U        set load type to A_tote6 S/ T# n7 x* ?7 |' n& K
        if A_tote="tote 1" then set A_induct to 1
4 N" u: J' x2 c( V1 y/ `+ K2 m        else if A_tote="tote 2" then set A_induct to 21 K+ K5 F6 Q" h% D1 a  V; }( Q
            else set A_induct to 3    ( P! h- K  h2 w" l
        set A_i to 0, [$ f) \, L8 h- s3 B$ r
        clone 1 load to P_induction
% V( d% Z. E* M! T7 p* t        wait for A_time sec
2 u/ `: _# Y9 J1 o; U5 u; E3 |    end; }8 h- ~; [. j# F
end* h  S4 m- z. g9 V

$ y/ M$ d0 W9 Q) G# Hbegin P_induction arriving
  F1 C4 K" F! ?$ }; g4 t! }    if A_induct=1 then clone 1 load to P_pick1( i& S* N8 G( u2 A" E
    else if A_induct=2 then clone 1 load to P_pick27 w  K  A& W5 c: a
        else clone 1 load to P_pick3
3 P' `8 `6 {! N5 H; G) Rend3 ^0 R$ L3 i) D7 Y+ u3 Y  _
% a( K( [" g# D* F5 P
begin P_pick1 arriving
. [* f: I* w$ a5 [    set A_i to 1( s& a" X8 h2 G# g3 K+ L- C
    move into Q_induct1
( f" ^( C1 z% I. M5 @    move into pickaisle.induct1: O. n% K( W3 N5 N/ Y0 n- o) |
    while A_i<=30 do begin
5 h1 P% I9 y! p! p        travel to pickaisle.con(A_i)9 q' O, O6 h9 Q: E% i& D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( h$ H5 E5 ]5 }% f. _
        else wait for 10 sec
# |' \9 w/ Q) t7 C* `        if A_i=A_leave then send to die1 p  {. E$ E, I8 q7 t
        else inc A_i by 1
- S1 R& O; D4 e7 x. M- C    end8 |; F& u3 T% e* F
end( u5 J4 Z$ K1 j1 n
4 B  R; c. C3 k9 j
begin P_pick2 arriving& F/ F: P; N$ N( v$ k
    set A_i to 11
3 z; f+ n( u" }- y3 f& X/ L' Q7 Z    move into Q_induct2
4 W; y6 i! l  Z  {, L" r2 {  g    move into pickaisle.induct2: Z" E, q$ T3 f* o0 O6 j7 x
    while A_i<=30 do begin4 U& J3 s2 v" o5 A( c- k( @
        travel to pickaisle.con(A_i)
4 v. L0 w- c6 m6 h) b% f* }1 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]6 b, D1 s% [9 f        else wait for 10 sec  f0 j9 L& N+ r4 S" Z& a  c/ {
        if A_i=A_leave then send to die9 R8 b, j0 s  @% S9 f6 H$ e9 k
        else inc A_i by 11 W# c& H# u0 E3 Z. y7 y
    end: K: |, O" m- w& ]) `' i8 L
end
: B* \" z8 |/ S/ ~3 E
# Y6 C, o8 s) Kbegin P_pick3 arriving
. M' R' _. u" _  t    set A_i to 21/ V1 l4 Q9 |6 T- ~$ s
    move into Q_induct3
- T4 ^2 K) K! D    move into pickaisle.induct3* G& j. ^  c) k& @: a! O1 p/ a* G
    while A_i<=30 do begin
. |/ e" F+ P2 k2 U        travel to pickaisle.con(A_i)0 g/ o2 V2 t( [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ^1 F$ {; d. s, c5 K3 v5 }1 J        else wait for 10 sec
& y- f& [! F! w+ a! ~        if A_i=A_leave then send to die7 h% I$ y" R! c" g1 A: e# X5 ?
        else inc A_i by 1/ f4 @! }$ Y8 [3 S8 [
    end1 j+ n) c( Q- A
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是个什么东东?
6 r8 O' u5 R7 E; i$ y) f9 Ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, ?( ?9 y4 [+ |. T7 Q: Q& W
$ a2 N) {1 P1 LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% T: l2 W. [; n/ N1 |, @
& C2 z8 T9 b0 _, Y0 x7 `9 B% Z9 ^! ^
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* x$ V0 J; D* Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ _- H$ x6 F4 _9 L' w7 K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: u, r$ h3 l5 n! \$ z7 [4 X7 O2 g3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  z$ [0 t- |4 G  O' r8 x- J
begin P_induction arriving
' r# J0 Y- Z+ ~    clone 1 load to P_pick(A_induct)
% F0 e5 G5 `7 S; \1 F. U; Wend最大的系" E' m* l+ Q( }2 \1 h
# y) [, x1 `6 X+ C1 k2 k- x
begin P_pick arriving! R% ]7 ]! c6 Y: d1 ?8 T
    set A_i to procindex * 10 + 15 Q; D4 D# N: i4 y) I
    move into Q_induct(procindex)
$ o! [+ x  K7 A    move into pickaisle.induct(procindex)* e2 Q+ |, J7 j
    /*check the type of pickaisle.induct(i), for your last problem.*/- @4 u  J& U$ h
6 J9 {  O- o. Z3 ?# V4 p2 ^- A5 b
    while A_i<=30 do begin
2 E9 d* w! k1 |. V! Y        travel to pickaisle.con(A_i)
; C+ y% ^# |8 {" V& i, \% I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: g% M% v2 `" V, K% m        else wait for 10 sec' P% P5 j  F. n8 y
        if A_i=A_leave then send to die
$ m$ V+ A* z8 U1 s3 d. j  Z1 s* v        else inc A_i by 1
6 i8 f: W5 [3 |6 P( W    end& i' d1 q" f  a, K% P, z( _
end
" V% I" X9 d! @3 R1 h, L% O4 }7 B& e" f: \
其中的procindex为整形,代表当前process的序号。- f3 `# O. t$ k* H+ V  x
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-1-28 12:06 , Processed in 0.018727 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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