设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15624|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, Z  o% s8 X9 i% s) L- u/ I0 T5 L% {. C) f( ?
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( F1 k0 `' F( A4 q3 z6 n

& H- S& }  E: Z8 K5 ~begin P_read arriving
) f2 @5 o% n) b, F2 O    while 1=1 do begin
) o' ^3 M: O) `        read A_tote from "data.txt" with delimiter "\n"
0 s% o5 b4 _0 I5 _! a        read A_time from "data.txt" with delimiter "\n"
% H1 T9 @/ |, H! ~# h        read A_leave from "data.txt" with delimiter "\n"0 Z4 [- I2 b# S9 U
        read A_picks from "data.txt" with delimiter "\n"
0 k) x# P: a; |( V: c, q% S" B& S: w        set load type to A_tote
& q% b3 b1 l& g6 i% e" d' d0 J        if A_tote="tote 1" then set A_induct to 1
( y" c2 R" H+ A7 b, Y+ ~        else if A_tote="tote 2" then set A_induct to 2
4 o" t$ P3 P9 b# p1 G7 h+ Z            else set A_induct to 3   
1 t8 Q8 l. a. {- W' \9 M        set A_i to 0
7 O9 p. c( B  p0 q$ H        clone 1 load to P_induction
9 G/ Q  k1 D$ x/ E) T/ b        wait for A_time sec9 e& U2 x) r( z  P) p) y
    end
0 X( E! ^2 v/ P, t( O: ^end
/ ]( y" e( U. Y0 ]# }+ o- W3 U; Q6 k* U- t( \
begin P_induction arriving
1 P% x9 D8 y, Y+ D- T% _$ Z    if A_induct=1 then clone 1 load to P_pick1
( E  E! ^4 l- H3 Q3 S    else if A_induct=2 then clone 1 load to P_pick2+ ^# c0 C/ p7 H- V6 W
        else clone 1 load to P_pick3. O4 r/ D6 Q  h" l
end
8 B1 W# R" `3 x
7 e0 u0 z- X9 n& mbegin P_pick1 arriving
2 P2 R9 d" x$ y* O% o( m  R    set A_i to 17 W1 E  ]+ j& K' z
    move into Q_induct19 I1 I4 R  o. N/ ?; e
    move into pickaisle.induct1* U$ h7 ]& X+ H) J4 f6 H
    while A_i<=30 do begin' s  g: S, _" G; c
        travel to pickaisle.con(A_i)
$ P$ C( k. E! P' M' |5 _" ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% t' T% q# q0 ?: i
        else wait for 10 sec
- O+ A3 m% Y" v9 X$ d        if A_i=A_leave then send to die/ Z5 H* q2 M! W/ K: A
        else inc A_i by 1
/ O0 z  }7 b8 |. u" i* K    end* S/ J+ U+ o' o. U; |
end
# Y$ m  J- F( u
+ F/ Y7 R) }3 B) Dbegin P_pick2 arriving* P% h4 Z% o# s0 O4 E6 A  ~0 c
    set A_i to 11
$ ^1 Q0 |& s& E; x    move into Q_induct2" c- R" Z* d2 |1 s4 z
    move into pickaisle.induct27 ?- _! \1 B3 \7 l) Q) O
    while A_i<=30 do begin
' y- L  o* d) B/ z        travel to pickaisle.con(A_i)3 C7 I5 x7 f0 J9 \. B; `) E/ _, ?$ `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ D) q- y2 @. C6 z% J/ Y+ F        else wait for 10 sec
; x4 d' a2 v* R6 P$ C, F( L        if A_i=A_leave then send to die
6 N7 B, ^9 \6 c        else inc A_i by 1
2 b5 G+ P' c2 v2 G9 M' x" x' K    end, x8 H/ O- A, B
end9 d/ X& Q& s5 A1 S9 t
$ d( c1 X$ j# N* }/ B
begin P_pick3 arriving
6 I9 y  Y. W5 L& R( O    set A_i to 21, ?5 x- M# u% Z- d; H" ~
    move into Q_induct3
; c: r; T  k! [- Y5 h    move into pickaisle.induct3) I" k* j6 J; @# `
    while A_i<=30 do begin
  {. A0 r  Q5 J6 [. M- D        travel to pickaisle.con(A_i)
% C7 h0 M* f, u/ ]: V2 A# Z& F2 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- Z4 Q2 D: u) S: y
        else wait for 10 sec
! b$ k, p, i8 f; \# l2 @        if A_i=A_leave then send to die. ]& L$ n( N$ L1 X! M/ o3 p
        else inc A_i by 1
! ?: r) B$ s, W* S. t, B) p& Q2 o    end% `$ e, x( ]1 f
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是个什么东东?! Q: y9 K" y1 W$ d2 q" N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. N, F7 F! ^7 [& V8 g2 b: U
. V9 E  R. [+ }1 ?( O2 J' ^+ s' H7 K
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- Y# E! R/ K) ?5 w$ k
9 ?0 H/ g. V7 X2 |  U6 z/ T2 Q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( A& C  H% s& H5 s" h1 G4 o: f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! `6 U- Y/ H- H* M0 U( q. a
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' L5 l- a% h: Q0 Q3 G" O! i$ k* g; R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 E. O7 K, I( A+ n. M* q
begin P_induction arriving* d0 a) V! i0 B. [. Y- l! K0 u1 E3 v. Q
    clone 1 load to P_pick(A_induct)
; \$ V3 _; n" ]" send最大的系4 G0 m7 h" |  d) }

; a! Q& w! T" l% X1 P; hbegin P_pick arriving2 y# _6 k8 V8 n  a, B& ~, e
    set A_i to procindex * 10 + 1
5 k6 K9 m8 @, z) j% w) N    move into Q_induct(procindex)$ @. ?. x2 ~* R! G
    move into pickaisle.induct(procindex). G" T# e" z" M3 _5 H
    /*check the type of pickaisle.induct(i), for your last problem.*/
- E0 u( U; ?- S( x) H
5 g3 k% z% o: \. n  d: [8 y    while A_i<=30 do begin
' a; G8 L% F8 o! [7 ]4 e+ \        travel to pickaisle.con(A_i)
- C% X5 |9 c$ O6 L5 f% q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 f, ?, Z2 W4 U. E# _5 R: n; }        else wait for 10 sec7 l; G$ ^4 A. _5 p9 n. ]1 h: [
        if A_i=A_leave then send to die- ?2 O( ~8 i6 b) e. P- d
        else inc A_i by 11 U/ o  Q5 G- |2 F
    end
9 @' ~: E; `, S- j5 ]% z+ I  z% O+ |* [. iend. ~  N/ n/ H. E( B- I/ U9 S
7 |, m8 a6 {: J/ }2 F  \
其中的procindex为整形,代表当前process的序号。
' e0 s- _# o7 Sstation和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-23 04:26 , Processed in 0.017114 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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