设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12430|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ p  @( K3 \3 t% ]& Y3 z
% `4 c$ p4 ]8 m6 m' q我的问题是,在每个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中的数值,不知道会不会有什么不妥。  ~0 [* i& m. n9 [: `8 W
  I: M  q* U# \! c9 A3 D/ O
begin P_read arriving
' h* ^7 R. a* i  A    while 1=1 do begin
$ T# J& ?2 w8 i2 q% g        read A_tote from "data.txt" with delimiter "\n"8 _! F2 \, k. D$ d; E' x/ a
        read A_time from "data.txt" with delimiter "\n"- e5 k5 Q" Z, t! a# F; Y, ~. B6 Z
        read A_leave from "data.txt" with delimiter "\n"& H% k' \2 v, a* e. Z( N
        read A_picks from "data.txt" with delimiter "\n"
* e2 p6 I! F. R' C        set load type to A_tote
: ~4 d( a( F" q        if A_tote="tote 1" then set A_induct to 1/ T% o' j* ?9 w, p6 a/ l, Q
        else if A_tote="tote 2" then set A_induct to 23 S0 l7 I+ N' \/ g2 i4 h9 m+ Y
            else set A_induct to 3    - i$ |. B. f- j  Q- {
        set A_i to 0* m+ Z& r2 w, G# S5 [- i, U6 p" A
        clone 1 load to P_induction
6 [4 B% s) Z1 o) C        wait for A_time sec
! C/ m# E: c" }. Y1 I. G4 M2 L    end
, y0 ~$ }+ b4 ~7 p( r0 Gend, F6 v$ ^) ~8 ^- f9 f$ T4 A
, r! k8 M8 d) W+ a' Y5 y8 q
begin P_induction arriving
% J' ?/ M7 ~% I# C" Z0 i$ p    if A_induct=1 then clone 1 load to P_pick1$ }/ M1 P$ ~0 A" R
    else if A_induct=2 then clone 1 load to P_pick2: L" H# U: [, F4 G$ a: g
        else clone 1 load to P_pick3; T# l7 e! U' i& @3 K; n9 m
end
* D( [* ]6 P! I# O0 u6 n' X6 X. Z) w5 }: s% K3 n
begin P_pick1 arriving" ~2 ]8 P5 J3 J' B  a! k+ s
    set A_i to 11 k9 I) Y' Z, H. V/ r( A3 p
    move into Q_induct1
; v6 {6 @* h# `1 T5 h6 B    move into pickaisle.induct1
' h7 K/ j* i; n) T8 |9 _& K    while A_i<=30 do begin/ k5 o, s' I7 ^0 F' p4 d7 z0 x( G
        travel to pickaisle.con(A_i)
' ?+ [, n) w. K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% H" q5 @$ A1 ^( `. t        else wait for 10 sec
: h' F8 F' x0 m        if A_i=A_leave then send to die
2 A  N* s& n- y3 M7 c        else inc A_i by 1
' r  ]* P  p! |0 w  ^    end
2 A" }/ n5 M% ~end( x& v' F: i- Q
* I2 P) ]- A0 @0 N) ]
begin P_pick2 arriving
1 W. {; L4 y4 j8 l2 E    set A_i to 11
. V5 g7 y  Q5 E9 }, M! V    move into Q_induct2
7 Q8 C& D+ \& z    move into pickaisle.induct2
- c; n  T3 w9 v6 R6 L# E" r    while A_i<=30 do begin# g# J" v& _0 _3 L9 w
        travel to pickaisle.con(A_i)$ q( A$ f4 u3 U, ]" t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; z: v  h6 E( d" y! M& n; W8 K
        else wait for 10 sec8 n) [) x/ B1 v: y/ }" i  N
        if A_i=A_leave then send to die  a5 x" c$ t7 @& J- D* n
        else inc A_i by 1
% u: [/ K, G" T* a, W! Z/ p    end
6 _# y8 W+ o  j4 ~end, n- Q2 t3 W) \/ }" D

" w  S: b0 C$ \( z) P' W: Vbegin P_pick3 arriving0 c  `! _+ s9 L8 V
    set A_i to 21) `3 k5 ^9 @3 n+ ^
    move into Q_induct38 ?- N& Q6 g4 \& ~7 |0 H
    move into pickaisle.induct3
& \4 H: Y$ E6 U5 O# w. C    while A_i<=30 do begin8 S& U& O+ ~; n( x) S/ m' T7 v
        travel to pickaisle.con(A_i)# R! S- v% O" `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ z# a1 r* [+ V6 I9 L
        else wait for 10 sec9 t9 I5 \* b4 D: N% l3 e
        if A_i=A_leave then send to die
& m4 I  `8 [0 t( T1 f0 W" n        else inc A_i by 1
- A- r$ d0 \! D2 u6 w4 t    end0 N* ]9 J* a' u* g. S8 B
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是个什么东东?
- K1 K  ~" |6 q0 H: A6 ^  C# m& I# ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) Z2 `! K! u  k; K) A* s* c; S6 c" d9 L1 f
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ p5 \! r+ U7 }7 @5 H, Z
- K3 ~8 h0 t. e
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 _+ b0 Z, j" _1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 m/ q' t6 A  _2 y; U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;8 D4 m  ?0 v; X# W* [
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* O; ~; Q0 U2 L* b8 z. \begin P_induction arriving. V2 N6 e/ {5 R- ^- W
    clone 1 load to P_pick(A_induct)# G4 P' E5 m/ G" k  L( b0 P( N
end最大的系( J  a- E7 G4 I# f# D: h/ o; t
3 C8 d7 U4 b6 \0 s$ A, G
begin P_pick arriving! K' d9 |$ y9 I* H( z! X0 h
    set A_i to procindex * 10 + 1
$ X: s. n) ~$ M# z7 L    move into Q_induct(procindex)
8 t: e: T8 O! r  ~) [0 ]6 T    move into pickaisle.induct(procindex)# @3 P; ~9 X5 `) U
    /*check the type of pickaisle.induct(i), for your last problem.*/
0 N3 p' [8 q/ V, a' q" v
: Z- x( y" W/ {4 p, s3 h    while A_i<=30 do begin
" S4 J1 O+ ^  Q0 |7 N' M+ _- t$ d        travel to pickaisle.con(A_i)( K' p1 C* g8 [8 Z) L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& o1 i  p  S% P8 Y  ?* F
        else wait for 10 sec
5 G% ~7 {1 F+ X# |" |- ^* e& e        if A_i=A_leave then send to die- z/ [! n& M$ e3 |$ ]/ c- k
        else inc A_i by 16 c9 I5 l. e# H
    end/ E( a; Q6 D, K# F& `7 H7 ?7 L
end
8 E7 V: ^4 H3 e/ D
3 n: j6 V! `$ s( o( O/ X/ }其中的procindex为整形,代表当前process的序号。$ {  E9 y9 P5 u( u. q
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-1-22 15:48 , Processed in 0.015553 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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