设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15377|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 g7 e  j9 R/ x. ^0 }/ y5 m# N# S) U" E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ }- K1 P7 B5 s7 S

* J3 c" ^# t5 Q" Sbegin P_read arriving9 H( u$ n2 h, x" A
    while 1=1 do begin
3 `7 G% }. Z9 [% Z0 n        read A_tote from "data.txt" with delimiter "\n"+ y& }5 z( a4 c; Q& m! v1 J
        read A_time from "data.txt" with delimiter "\n"
) Z" m5 s' c% k2 C7 a        read A_leave from "data.txt" with delimiter "\n"
2 Q5 v# l6 O/ ~6 p        read A_picks from "data.txt" with delimiter "\n"
+ u% ?' P) V3 y+ ~$ D9 R        set load type to A_tote
. r3 x% j* z; ^9 Y2 Q/ v: a* B        if A_tote="tote 1" then set A_induct to 1- k% R  [* P4 ]
        else if A_tote="tote 2" then set A_induct to 2% }( ?9 G. U1 S' x
            else set A_induct to 3   
* ~/ q6 P" I: v0 T8 C$ {        set A_i to 0" q5 c1 v  c$ X% h* g' h  v0 t; B
        clone 1 load to P_induction
0 A! M4 b4 K& ~% C8 ^        wait for A_time sec
  b$ B# _5 q1 {, t' r9 @    end" l3 Q0 Z+ k7 ^1 Y! v# @$ `
end% ]0 J# b4 D9 s7 _
9 T2 t0 q8 p4 l- I) e" r
begin P_induction arriving
: H  F5 Z  u6 X6 e" o3 F" |    if A_induct=1 then clone 1 load to P_pick1" U) G5 ~( \- c& C2 ]/ g
    else if A_induct=2 then clone 1 load to P_pick2
7 u* U& `0 o8 k6 L: L  A        else clone 1 load to P_pick3- V3 D$ X0 S. y4 Z% z/ C! \- e
end
( Q& p- v! ]8 E0 J9 C2 t; _( _
- i" a0 k# }! Q0 vbegin P_pick1 arriving4 _: S7 p8 ~- O/ d; A$ b3 _8 C9 d
    set A_i to 1
, [6 _# y  Z; E5 t! }4 A    move into Q_induct1- L; h2 n$ w6 b" x( z) W$ ^
    move into pickaisle.induct1
: s8 ]6 N" @% S. R7 B- u    while A_i<=30 do begin. }6 O6 W8 b0 \! W8 q2 [
        travel to pickaisle.con(A_i)
. r& s0 Q! B5 `- Q% _5 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) O. G4 I1 i* |; M        else wait for 10 sec7 c  C8 x% b; _
        if A_i=A_leave then send to die
8 e5 _( W9 `) ^        else inc A_i by 1
7 z4 {  e7 \& a: o    end. {% U0 H) A& h5 r+ R3 q
end
, d: P5 b8 [2 F1 l2 M: l3 V7 @
0 m1 x& N* L( c& t& Pbegin P_pick2 arriving" `. a$ |) S+ t# s
    set A_i to 11
: J; W5 x& E  Y6 n    move into Q_induct2% p0 \% o$ V% g& q$ }7 f
    move into pickaisle.induct2
5 p- k! P1 w" ^* V, X6 x8 I4 X    while A_i<=30 do begin& ?3 t) q7 N6 x# V$ e; O
        travel to pickaisle.con(A_i)+ a- \0 S7 e$ w, E9 ?! c+ P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; K( u; v1 R# k
        else wait for 10 sec& f" M* X) v9 T; W5 N' i
        if A_i=A_leave then send to die
+ r$ Z, K, `# y        else inc A_i by 1' w$ N8 c+ I. ~0 u- t6 P% T- e% k: V
    end% p2 p# Q* M7 A( g8 U% J
end4 u' R9 T: P+ }9 I  L- Q* C
2 ~. y. k1 P' u8 F0 N* l- e: ^& T$ N+ h" D
begin P_pick3 arriving
  {1 Y2 J( s& @2 P% ?- ~1 ?    set A_i to 21, q+ [! z; i! a2 M/ [
    move into Q_induct3
3 u6 \, U& C  d  z' A    move into pickaisle.induct3' W# c3 ]0 K9 i* M4 t0 c
    while A_i<=30 do begin
5 D1 d: d. M& w& t5 X3 Q& v        travel to pickaisle.con(A_i)
$ \0 P+ F) v- Q! u6 j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 J, h$ {+ D8 F# l6 D
        else wait for 10 sec
6 a8 @3 ]8 E0 s! Q) |( C# Y        if A_i=A_leave then send to die* m1 z+ y8 W* L2 P& G9 j
        else inc A_i by 1
2 l: L/ G" o7 z( h4 o! t! O! ~  ~    end* {. b3 X0 S# ]2 I: B- u
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 u# r6 R% ^2 y. I& _) D9 Fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ V3 j% D; `% s3 C# G) @
2 ~* Y' K( l+ A; uAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 }( Z5 O  x" s- C. F

* Z: u% }* K: h" v, R% @2 v8 `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 ~. b' V2 G/ J6 u) t! h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 |7 D: n6 `) @( i: N4 m6 `3 X2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 ~! J$ q" O: n1 M  a  a* S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# b, f3 G9 _* G5 C; o+ h' E
begin P_induction arriving
* ?. z. N- T* p* Z5 G5 @7 n8 r    clone 1 load to P_pick(A_induct)
' f7 U: d) R8 e3 o) {; @end最大的系
+ s/ t6 r4 S* c$ v  g
9 v9 G6 @5 c6 Bbegin P_pick arriving8 U" {) O  E8 N, D0 X* `7 O  k
    set A_i to procindex * 10 + 16 W7 Y3 z/ [/ O  B9 q( }
    move into Q_induct(procindex)0 h5 [& R% O7 L- t- B) g: @$ Q  P$ Y
    move into pickaisle.induct(procindex)' c- Q! t5 O* F
    /*check the type of pickaisle.induct(i), for your last problem.*/4 a! k+ x" Z( p* y
' d# h" C9 H" s3 n3 \; ]( j
    while A_i<=30 do begin
# r" I( Q: l/ }3 O, C& v        travel to pickaisle.con(A_i), k/ N6 o8 R2 @$ e4 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 u+ J' f  K; {5 h$ x( u/ {
        else wait for 10 sec
1 n* c+ i- A. Z/ b, m( Y% B7 w% K        if A_i=A_leave then send to die
, @; @0 _* M, V7 t9 e        else inc A_i by 1: F+ b; P! @8 u5 N9 a2 O; i6 ~
    end+ _+ m3 `6 [& U0 }
end
6 v' P. D6 f7 U# n
8 k8 m# q# Q! R7 ?其中的procindex为整形,代表当前process的序号。
0 \. [! O' ?( P" y& `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-9-7 07:41 , Processed in 0.018933 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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