设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9766|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 [; R, W& v2 G! |5 n' [; r9 S) a. p- ]8 |( B/ b  G, H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 m+ k( ~& h& j4 e
9 ?- V# V2 v' o. \3 V; mbegin P_read arriving
) W: q& \' v8 |$ i7 @    while 1=1 do begin9 g! U* I# \$ V1 H4 ?2 t
        read A_tote from "data.txt" with delimiter "\n"
, x8 V8 o/ `9 f: p0 n$ }        read A_time from "data.txt" with delimiter "\n"
4 d! H/ {3 z, G% H        read A_leave from "data.txt" with delimiter "\n"
; h8 s9 _% ^! i3 u        read A_picks from "data.txt" with delimiter "\n"( ~- \, Y" [& n: m0 h3 V
        set load type to A_tote2 p! d# D2 f# T8 C$ c2 _
        if A_tote="tote 1" then set A_induct to 1: `% m2 R' k2 V. c7 d1 x/ a
        else if A_tote="tote 2" then set A_induct to 27 x3 y1 s( Y% x6 e8 B: ^+ J
            else set A_induct to 3   
# o: c% b+ ~- b        set A_i to 0
/ a6 j% U1 ~! Y8 H% D1 \+ @. {5 @        clone 1 load to P_induction
5 \3 Z% t3 v4 x        wait for A_time sec* H7 r6 ]1 r* t3 N  D$ j4 c9 N
    end6 @+ y" k+ {% i6 x7 F8 [
end8 T- t; ?. n1 e% s. s, {% m9 H
! e* D3 u# t2 L$ [% r. }. [2 i
begin P_induction arriving
/ v( c, N0 P0 f    if A_induct=1 then clone 1 load to P_pick1
. X! b& G  c3 u6 N* r# A    else if A_induct=2 then clone 1 load to P_pick2# I* W% b2 ^' |. M# }
        else clone 1 load to P_pick37 W* |8 U& \6 |7 r
end
& R9 K6 H0 a! r! R
# J' ?2 [5 }9 T; x  t2 v: s3 ?begin P_pick1 arriving
9 f+ v1 \& n5 m5 N    set A_i to 1
* D& S" x  b  t3 r    move into Q_induct1$ w+ g" h1 e+ Y3 o
    move into pickaisle.induct1
/ ?, G* @/ Q* X# y    while A_i<=30 do begin
: N/ `  {7 ?; H, Y2 K$ q# L        travel to pickaisle.con(A_i)
8 E% {6 S  }, s% d5 ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 h. N& `7 @' r8 g3 |
        else wait for 10 sec
2 E; Q& _& @: J/ \        if A_i=A_leave then send to die' a0 J1 `. t7 G- e' D
        else inc A_i by 12 F7 C; T1 x/ v. p
    end
4 S! @7 u# _$ M$ m/ k$ J9 nend; e1 w! V, x9 L+ O& K# f# z* K
7 q+ N. t6 l/ \1 m( k! Y/ P6 ]9 O
begin P_pick2 arriving4 {+ F+ }+ ^; c. ~; G
    set A_i to 11
% w3 C1 H" x6 o# h5 r5 G7 h& J- h    move into Q_induct2
9 R; |; X! H% A8 W& ~$ E. Y7 h    move into pickaisle.induct23 g8 j3 e& Z$ o  z. T  z" z, y# f5 T' u
    while A_i<=30 do begin: V! @$ s8 D5 m. }' e4 r
        travel to pickaisle.con(A_i). o; b8 M! d$ Y3 |1 Q* l# G, C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: d" D7 J5 r3 F+ {; \1 W0 }0 ~
        else wait for 10 sec
6 D; h: _# V: o; u        if A_i=A_leave then send to die' s$ E8 W+ e9 V5 y/ d, a4 b
        else inc A_i by 17 h) U: `0 Z9 `8 Q4 L: N- b
    end
- l# v+ g0 z4 X0 a) B: X* P8 R0 z' send
& T2 \9 ~  [1 S- d8 x- q5 u& L  H- Q4 ]7 T# Y
begin P_pick3 arriving
) Y$ W( h; l- J6 B    set A_i to 214 u3 R, W! Z. B4 i& u2 V/ E$ ^
    move into Q_induct3
, P" v( r  q, z3 c! [/ Y    move into pickaisle.induct3" N3 b6 a1 E9 w6 `
    while A_i<=30 do begin
( U( l% F7 @9 M        travel to pickaisle.con(A_i)
5 X. }+ p) u; B! ~$ v: c& N1 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 G/ x) h) b! s, U! u        else wait for 10 sec& ?0 _; u7 V. D/ Y. d" R8 N
        if A_i=A_leave then send to die5 E/ q7 y2 G( e& m& D/ d
        else inc A_i by 1
4 ?5 k* c- H" {& e    end
" ]# N5 Z0 t' L$ d; ?+ o, ?) Dend

最佳答案

查看完整内容

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是个什么东东?3 O6 N1 B9 k* l: S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% L$ l5 _  t" Z$ P$ C! K& C
4 }/ u7 r/ U+ B, j, a1 iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 B  \7 b6 @2 w# ^* _1 K' f4 N  u" J
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& R. t3 W2 p5 i, I7 x! ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 R6 P  w: I( a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% H! q3 B  x4 e9 K. R2 s2 A: S+ A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( r) u, w2 A. _2 h
begin P_induction arriving
' }! u3 D2 Q. u. `; b    clone 1 load to P_pick(A_induct)
2 L  t5 M6 |; Zend最大的系' w- ?% z: Q4 P: A# U( ^# w
. q/ v/ w5 C9 H
begin P_pick arriving( R6 R4 J" z9 C  P+ T& k
    set A_i to procindex * 10 + 1. G3 K5 V3 T1 M, D4 T5 N4 M! ~. N3 N7 m
    move into Q_induct(procindex)
9 ]) C0 S( o$ w    move into pickaisle.induct(procindex)" f9 ?' l; v# [; D0 k
    /*check the type of pickaisle.induct(i), for your last problem.*/1 J5 D6 V# ]" @7 }
* w8 a  G3 d$ {0 ~+ k
    while A_i<=30 do begin: d3 d, }/ H3 K# B% g  Q; k( \' o
        travel to pickaisle.con(A_i)
2 d) ~  \+ j1 q$ w0 {* s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 z- M! h6 O* D* E6 i5 [/ Z- N$ G5 K        else wait for 10 sec8 z9 b! w5 z" t1 l" h* B
        if A_i=A_leave then send to die
) R7 \7 H* {. P! n) Q% {% |  _  Y; E5 h        else inc A_i by 1
; z' O: X# M" _    end
/ |* D4 t5 j6 l; g0 I( Fend
9 P9 ~( z$ \( c" l
7 G3 P" Y2 [, e其中的procindex为整形,代表当前process的序号。
8 |. V$ {# M' y8 q$ Astation和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, 2025-7-3 08:33 , Processed in 0.013966 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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