设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15115|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ k$ O% n* G  Z. @5 {
5 A, b+ X5 w: G/ b. x6 ~! w. ~我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 L: N3 h4 j3 R

+ N5 j6 }- x# m# [) N5 c0 xbegin P_read arriving/ M6 [6 i) r  a7 X% H% w
    while 1=1 do begin
5 d' U0 z* M" b) H2 d6 d        read A_tote from "data.txt" with delimiter "\n"
2 x* P* o* G% G        read A_time from "data.txt" with delimiter "\n") S2 Z+ o7 L. S; t% n$ i
        read A_leave from "data.txt" with delimiter "\n"
! E8 j- D6 ?( I0 D        read A_picks from "data.txt" with delimiter "\n"9 a' Q% Y  G* t0 r
        set load type to A_tote0 H8 t' X- @1 L4 d, }2 Z$ L& t' d1 o
        if A_tote="tote 1" then set A_induct to 1( f6 N+ k. {; O  ]- x6 C3 f
        else if A_tote="tote 2" then set A_induct to 2+ s4 G9 @7 L% F) D$ z
            else set A_induct to 3   
  n" y5 d% y7 q7 u+ K        set A_i to 0
4 i4 y. @! x' [( z, p        clone 1 load to P_induction
' V" a; u( m$ z3 G$ t9 T        wait for A_time sec. v/ Z* R- p, F" y( i1 P
    end2 P& h0 N1 l9 U/ T
end, g. a) D/ T6 ^* b

. f$ p% E+ Q+ }( q% Obegin P_induction arriving5 o8 z  O" W/ y. M2 d' h
    if A_induct=1 then clone 1 load to P_pick1
% \$ `5 q6 |/ E, ~+ f    else if A_induct=2 then clone 1 load to P_pick26 }3 @" K4 n, g/ C5 I2 @  \5 g
        else clone 1 load to P_pick3
1 e& x6 w2 X$ W3 ^. x* X; E3 @5 M' ]end* X7 v/ z# U, H! O

* f9 T3 `, b! q) U* `0 \" i: H( }8 Bbegin P_pick1 arriving
+ g. h0 A* |/ m4 R6 m    set A_i to 1) B* ]8 q  ^0 N* a; ]
    move into Q_induct1
1 c* ^+ n. r  \  D' d; A. i    move into pickaisle.induct1
, u6 `8 U3 O. ^, \    while A_i<=30 do begin
# }9 A2 B0 ?3 F- U! h1 T! U, L- B        travel to pickaisle.con(A_i)* ]; ?0 b4 j4 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& r/ z' q; I7 J5 `; ]
        else wait for 10 sec
( q4 n+ d! J% }2 t        if A_i=A_leave then send to die9 [! ~; ?) q9 d2 n+ a
        else inc A_i by 13 N) u* L& N& F6 V- }  e, T7 F
    end) N  X0 R5 b- [% S& E/ i
end4 q) F  W' k3 i0 l3 G4 N, z

% a+ c- ~0 t1 S9 Gbegin P_pick2 arriving
* l2 |5 Z$ l: a    set A_i to 11
: `: c' M" K9 G/ C+ V" ?1 _* E    move into Q_induct26 Y* J% A5 A8 Q, I
    move into pickaisle.induct2* @9 ?6 G: B2 e2 y
    while A_i<=30 do begin- f3 j6 T( G. z+ M& O
        travel to pickaisle.con(A_i)
9 b! [. i0 Y* D4 c7 k3 x0 r9 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 j# F* \0 m+ l4 \1 C7 n& S, |8 o# ~
        else wait for 10 sec- I% T2 ?! @7 a& q6 Q$ `3 ^* }
        if A_i=A_leave then send to die
' Z) m0 I  O$ _        else inc A_i by 16 Z7 O" U: w: _' M- m( ~
    end. C5 R* a( N! {0 ?! q- B# y7 v
end% m( b% k. }" q* D/ f
+ P' ]& Q3 L$ l8 y5 B+ n# m
begin P_pick3 arriving
; V8 V9 q3 K2 D+ M  ]; L: s    set A_i to 21! p! L" w( `: n% _# v
    move into Q_induct3! a. V/ E2 u- \& `  Z& K# B
    move into pickaisle.induct37 E& _2 K& K8 O9 G4 x6 O
    while A_i<=30 do begin4 G. t6 q. ]$ s( N7 ?: i/ P
        travel to pickaisle.con(A_i)
9 J' M2 B$ ~5 u2 z/ I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" g* q- f5 Q, n$ D        else wait for 10 sec3 x0 u3 C: Y4 g/ N" s' s; S% C
        if A_i=A_leave then send to die" ~  D) a3 j6 C7 i- e
        else inc A_i by 1
# z. w6 L- o2 h& Q# a  u3 N    end
, ]; z; G, U( Kend

最佳答案

查看完整内容

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是个什么东东?
8 I" r& f% x( M7 y2 M8 pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. j7 ^( W: c, M; b
" c9 F+ b. T7 B- n2 y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- W& m- @/ h2 b% N4 J

4 S! n& X' R  |( d3 s另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ w3 b" K% V" g! q% x9 H# b1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! }- C; |) D1 R6 F/ f
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% E8 H( \8 c8 g  y& _) s2 ~
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 m1 `1 A( J( D9 s. U
begin P_induction arriving
8 }; V" _$ }6 S5 Q    clone 1 load to P_pick(A_induct)& L$ D# u0 \% h; A8 q' ^/ S
end最大的系
$ B, C8 g+ I* h/ g- k; L: ?4 S: _, d. p4 d0 G6 D
begin P_pick arriving
1 P7 r& ~3 B9 S8 t    set A_i to procindex * 10 + 1
4 n7 b5 N5 e. w5 [" f, h) L$ U    move into Q_induct(procindex)4 N) Y2 J0 W# ]8 s- P/ [
    move into pickaisle.induct(procindex)* a1 Y0 v7 |& |
    /*check the type of pickaisle.induct(i), for your last problem.*/) E1 M; Y9 U$ z9 F

, H! Z  Z% x- M% ]6 }: n7 y. T3 `    while A_i<=30 do begin
- [: A; i8 [, @& K        travel to pickaisle.con(A_i)
7 ?( {- E, e/ I$ x; X! d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: `; T! P& E/ V  z4 S: @
        else wait for 10 sec& z/ Q& @$ Y( N' X- R/ l
        if A_i=A_leave then send to die, f+ t+ n- P- g$ H* u" Z
        else inc A_i by 1' X) M) z3 e: V4 M& C; N
    end
2 K9 ]7 K9 ~: p0 A) x, \end
  z& V/ ~' B4 k1 A
* B! c: J7 I6 }1 _. V其中的procindex为整形,代表当前process的序号。
5 F, l, H2 n0 ?6 A5 g' H5 J4 J% ]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-8-12 01:40 , Processed in 0.019833 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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