设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6161|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, T1 Q# v( f! j2 G  O5 @9 |" M' B$ e0 Y2 y8 H) 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中的数值,不知道会不会有什么不妥。# d* r. Z' P6 f* @7 s0 m

+ }# K) o7 W2 F2 P4 L" D0 rbegin P_read arriving& e, b& e" e, o8 P; v$ N( c' m. X
    while 1=1 do begin/ U/ N) h; _0 n! |+ {, `
        read A_tote from "data.txt" with delimiter "\n") Q% G2 ~, P' n7 k! Q; b
        read A_time from "data.txt" with delimiter "\n"+ F0 [- D* u8 L7 J6 I- B
        read A_leave from "data.txt" with delimiter "\n"
0 s1 O, u: T: S1 I1 l, A/ `7 P$ }( T        read A_picks from "data.txt" with delimiter "\n"5 @& m+ ~! z2 O" R
        set load type to A_tote
5 C! E2 `! M$ J) x( ?  B/ f, a' A        if A_tote="tote 1" then set A_induct to 1
& _2 U8 y- F6 k4 O1 M        else if A_tote="tote 2" then set A_induct to 2
7 H. S' B, E/ A3 w' q            else set A_induct to 3   
) r0 }( `; U! Q$ ~1 A9 K        set A_i to 0
5 x) m) G" f' c9 Z5 [        clone 1 load to P_induction; x9 j$ l# C  D2 z
        wait for A_time sec
: \8 l6 A* l2 v    end" y3 Z( B0 f0 X" L( m$ Y
end
7 ]- g- U0 L" h5 o1 _
9 }( u) {, K: k6 Wbegin P_induction arriving) F( X/ y, t7 j6 O: R* v
    if A_induct=1 then clone 1 load to P_pick1/ ~* p; {0 w! I0 F
    else if A_induct=2 then clone 1 load to P_pick2
/ t$ R% V. B5 w4 y        else clone 1 load to P_pick30 a# J- t" i# @5 G
end. b4 }& G* c: R; Y" V3 P3 m+ A

5 s. `" r" [* l8 Bbegin P_pick1 arriving8 ]6 q" x5 Y( I2 H& T/ I6 I9 U
    set A_i to 1, g* b, R8 L* w% a; L
    move into Q_induct1
- J' n& a! u& f& m. M' I, h    move into pickaisle.induct1" N# P* k# W  U: y- C; `
    while A_i<=30 do begin
9 r! Q3 ?5 `) L5 p- b9 ^! U3 i  {        travel to pickaisle.con(A_i)1 w9 [: b# `( W: t  c6 t& V; ^! a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% j% v6 D$ l/ @/ x) c
        else wait for 10 sec" A. ]: |* c+ Q3 h3 \
        if A_i=A_leave then send to die
3 o5 T1 b) ]: y# X+ t        else inc A_i by 1" w- H% d8 R% Y0 J; W5 |) Q
    end4 J7 h/ t2 ?4 m
end) a2 D* b8 h. s$ r+ ?

9 L* k/ ?" D" N2 ]' K/ p+ w, T- [begin P_pick2 arriving
- ^/ B, A9 _) Q$ X3 `    set A_i to 11  l4 M, U% t4 r  F' Y/ B. ]5 C8 }" _
    move into Q_induct2
' X  c( f# o/ ?: M7 |    move into pickaisle.induct2
9 j2 o8 X$ B: `3 B* I/ [; E, b. Q    while A_i<=30 do begin( ~' F1 J- G6 z) E" M
        travel to pickaisle.con(A_i)
6 Y! ]% \# u: Y% k3 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 N# e( v+ Q) N
        else wait for 10 sec2 H% r% c+ i8 P$ W
        if A_i=A_leave then send to die
- \  S# w' p, L! C9 b8 g+ M% T        else inc A_i by 1$ C! G7 I' E' Q  s1 e/ @3 w
    end, j1 K; i7 k+ t
end
* O" [- \: c( H1 P) A; I2 b& b* U, l3 B  S6 k. D8 n
begin P_pick3 arriving5 Q% X+ Y: w6 V9 O0 X! r
    set A_i to 21( N: y+ _' G+ M
    move into Q_induct30 J; a* h# M8 c1 P5 `5 @% \$ q
    move into pickaisle.induct3
. D% g  R0 |' d5 Z0 e    while A_i<=30 do begin1 w2 [( s/ D" U3 d/ [" K
        travel to pickaisle.con(A_i)
% U) O8 ]$ G5 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 z2 U$ L% T: Q2 ?( Y
        else wait for 10 sec, i8 n# X, w  E/ F
        if A_i=A_leave then send to die
' ~+ @( D' }. c% t- I! `        else inc A_i by 1
+ y& I8 a5 n5 I7 U    end
, J& ^# l6 n0 K. Zend

最佳答案

查看完整内容

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是个什么东东?$ t' I, F+ o- \' R! D6 G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% D  j$ x9 L0 `

7 j3 n/ E% q0 @8 A- _  EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% g, k# R6 m- u3 F2 M1 h/ \" s9 t' \* T" b  O
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, T& n4 O6 S8 K% ?& q% a1 n
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" d# g. Q# v! b7 ~5 E/ J
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 u: @* [. }* K9 x7 ?3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 O- V4 s) L4 ^2 v) l
begin P_induction arriving
) z) t% H% o' t( G+ z! c9 C: U: l    clone 1 load to P_pick(A_induct)4 S5 {. Y- a# K3 i' b: A
end最大的系7 f( F) n6 `6 W* Q! ?1 W6 S2 h

3 }$ S4 C: t4 E) ^! [# |, ybegin P_pick arriving
$ y( b+ P. X0 P/ @& f- s! }    set A_i to procindex * 10 + 1) x6 f% z# {# Q- S5 s# a/ E
    move into Q_induct(procindex): B# A" R6 B! d0 D7 u$ O4 L9 U
    move into pickaisle.induct(procindex)' C9 m# m  Y$ |0 V+ @& ?* v; P5 U) @
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 ?: u$ m) l9 j' `
1 [4 B2 a3 X& c; B4 R8 ]    while A_i<=30 do begin
3 ]. r. |0 S4 ]2 B        travel to pickaisle.con(A_i)
6 u2 s8 i: N# k# D  y; O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ d$ r6 J0 l* m& A1 e        else wait for 10 sec! R. n. b8 _+ f  `, N
        if A_i=A_leave then send to die! o8 r( N5 b! `
        else inc A_i by 1" Z2 t, q# [! s% m8 K& O2 Z# Y
    end
9 F' G5 D, ~" F# K1 Bend
! j# `+ _; {. C* E$ U7 T3 `& m  H; {# g8 Y9 `: G& r1 r
其中的procindex为整形,代表当前process的序号。
' F7 f+ N( k; L6 f+ N$ m( Y0 W2 G, ~) Fstation和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, 2024-4-20 08:37 , Processed in 0.016816 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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