设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13646|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- L5 v7 V4 l# u3 o5 f% D/ u
& b1 V/ f# P  r# v/ h0 p/ S- G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; A. L: J& h9 ^& S0 ^  T9 H8 A# }/ u. b2 x
begin P_read arriving9 D4 i  e+ z) z% A: U0 R7 ^" l
    while 1=1 do begin
/ k7 U& \7 S- P( B; J+ {; H9 n4 k        read A_tote from "data.txt" with delimiter "\n"
/ v; M; t  i( p) S/ Z9 \8 n        read A_time from "data.txt" with delimiter "\n"& S% D4 d( O3 M. t1 M2 T
        read A_leave from "data.txt" with delimiter "\n"3 Q) S) t% D, g  T5 B; v7 A* @
        read A_picks from "data.txt" with delimiter "\n"3 n, B; v/ R7 y' ]* @& p6 P
        set load type to A_tote
7 @: C. w: h( w  L6 v+ J        if A_tote="tote 1" then set A_induct to 16 D! T% _" J( a( Y* M. [: w
        else if A_tote="tote 2" then set A_induct to 2
3 S8 C3 i! e4 T2 T            else set A_induct to 3    6 h% K9 B- b! M, Z
        set A_i to 01 O: l+ z+ o! D
        clone 1 load to P_induction* ]( F+ r( }7 O1 p& J+ F
        wait for A_time sec) ~% s: b2 q6 a& X
    end6 K4 x' t( m4 [$ Y  m3 U, W
end
( T. M: @# z3 Q. S$ a& d  ?
- R6 g' S( _5 u8 q  G, `* S4 wbegin P_induction arriving
5 e) }3 g0 q; M6 w) ~. s0 U9 W    if A_induct=1 then clone 1 load to P_pick1
5 i* G4 C9 c1 r& u3 z) ?! z    else if A_induct=2 then clone 1 load to P_pick2
3 {8 W# F0 r* i+ R/ x        else clone 1 load to P_pick3* a; a9 z% N, P* E
end; u/ g& W  N3 O3 q; x

& M# d" }! w4 |( |  nbegin P_pick1 arriving
1 T8 X8 v# Q2 E( C    set A_i to 1
* C" S3 i' a2 L# q4 w& H    move into Q_induct1% C; e( {8 r7 d* x7 F2 i/ b2 ^
    move into pickaisle.induct18 Q; b) k: a5 Q5 T  F$ ~
    while A_i<=30 do begin
/ @2 v, J3 r' r/ q& H        travel to pickaisle.con(A_i)
( y5 O; x5 u6 a/ P6 F* M; @0 S- R* `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: P0 g1 e2 Z7 b3 L- S  n
        else wait for 10 sec2 ]) {1 x4 l/ d
        if A_i=A_leave then send to die' o. h$ J$ x$ ?2 Z
        else inc A_i by 1+ m7 B5 }  r8 w8 I& L" q* `
    end
: L- H5 m! y& U2 d; @! G$ q  kend; s1 V! D4 D. f; B, U9 H( R
0 |! O# Q: u# N1 b- S
begin P_pick2 arriving
4 c$ [8 [  x! h9 v2 V: }3 ?5 \    set A_i to 11
" I3 E8 n3 I2 ~1 v+ L" X3 I    move into Q_induct2- q' g7 A7 c! d( l
    move into pickaisle.induct2$ z9 d' y. |" Q
    while A_i<=30 do begin7 ^8 @6 M; w, h6 z/ @
        travel to pickaisle.con(A_i)
  V& ?) c$ M9 u* V+ X: ?8 Q7 `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) M- R- _' d. X6 x, S        else wait for 10 sec
8 ?! M7 }, z8 w8 x& d        if A_i=A_leave then send to die
4 e4 m) g# {1 X        else inc A_i by 12 i! R" p2 N$ Y9 V* y8 C1 \3 D
    end
- L" M1 W7 z" C" Q0 d) send
/ o: e- t. f0 D- D* I. C$ p
2 y3 Q* i. w1 F. u" m  U! Ubegin P_pick3 arriving3 G/ K' P8 ~. @+ q% |1 K5 v
    set A_i to 21% E( s) B! k5 T/ Q  N2 r. J# \
    move into Q_induct3
9 H1 Y( `: U, B0 x8 T  G. Q  |5 v    move into pickaisle.induct3  c8 G, I8 J) \4 U1 i8 V
    while A_i<=30 do begin" ]( y) ^6 t' U+ ^
        travel to pickaisle.con(A_i)5 X) a3 S5 b% p) _3 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 V, `  F! q/ l2 H- }  i1 v6 G
        else wait for 10 sec
$ u. ]" k& ^5 A6 E, `* a2 Z5 M        if A_i=A_leave then send to die
0 C1 V9 v" R; @- w+ H5 \4 Z# F        else inc A_i by 1
( U& d- u  w" |( _$ x% l; b  E/ _    end* Q  O, d2 e* Y' |& b, Y: |4 E5 e
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是个什么东东?& c! A% @, M/ p* |1 [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 n& e" H+ a+ l, ~/ M& i; A2 }3 e6 w* k  w4 p
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 V% k( Z- i" S7 M" e
* M0 q+ C8 ]# C" g" G0 J! c; ]( }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 v- m" I/ q) `! s" s: a
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 j$ O1 e8 ~( g. ^0 r$ Y+ {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 g- Q/ p! @" ?5 `9 ~8 {, V' k
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 Z  F! q4 u3 A1 N2 x" L  Ybegin P_induction arriving! D7 U2 n) F8 R7 o- X' f3 ~6 O1 o
    clone 1 load to P_pick(A_induct)! l. a* j; q3 M. ]6 w0 ], F& I
end最大的系
8 B6 H. Y6 p7 T0 ^* t7 E( `2 k9 ^1 I) P7 e3 c
begin P_pick arriving- p$ n; T  z0 q% i
    set A_i to procindex * 10 + 1
0 C$ F$ c9 T3 c( `: }+ @    move into Q_induct(procindex)8 d0 |7 E6 g+ i' R
    move into pickaisle.induct(procindex)
" R& X0 T9 v/ ^8 \! @! |, {. R    /*check the type of pickaisle.induct(i), for your last problem.*/
- Z- ~9 L4 r  `8 b" T* r4 I- {
7 J- u2 k5 E  X: j. I    while A_i<=30 do begin
7 ~( }# `$ ]5 Z        travel to pickaisle.con(A_i)
. j8 j- N' g) Y2 z) N0 u7 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  j! z* C4 D+ k" m: g& n
        else wait for 10 sec
: F, i" F4 S2 d) U" q: ?' K        if A_i=A_leave then send to die7 p! O' h! o0 B+ {$ R8 @1 ?
        else inc A_i by 1
' T5 `( Y( G# }% G4 z    end
8 K7 P* L0 Y6 D% F3 `  q( xend
' J  d' n& X) a3 C9 d# q0 p9 j& z- s( ~
其中的procindex为整形,代表当前process的序号。
- F1 Z# |; v+ ^3 A, zstation和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-4-26 03:43 , Processed in 0.017614 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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