设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13922|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ v* k( J' ^% ~: h. y

  V6 X& \! N1 Q. h2 l7 @, y我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 C2 c  H. L& x+ q& N! l% J
# ?( r" A# W' G9 }" v; V  k
begin P_read arriving* O# I2 g- z. }+ m
    while 1=1 do begin
) o8 V* K- D7 e+ g( h2 }3 d% ~/ \        read A_tote from "data.txt" with delimiter "\n"
+ a3 [+ ], ^) H! n        read A_time from "data.txt" with delimiter "\n"- w! G, g7 j4 ^. A( j
        read A_leave from "data.txt" with delimiter "\n"+ Z: d' M0 v1 }8 Y8 n
        read A_picks from "data.txt" with delimiter "\n"
- X6 {1 C1 c& w/ i        set load type to A_tote8 b3 m* c# W& I  i
        if A_tote="tote 1" then set A_induct to 16 v& e" ~& o, u$ s3 N
        else if A_tote="tote 2" then set A_induct to 2
- @$ Z. z  M/ }" J- N* o# H% g5 C" E            else set A_induct to 3   
& N, ^: ~5 e9 d5 \; V        set A_i to 0
* v! ^" j2 l4 p" c% _        clone 1 load to P_induction. A+ Z* l1 B& b6 E6 C! ~
        wait for A_time sec2 q8 ?" e0 w- z: ^5 b% y
    end
$ k$ T7 f, v/ E8 u1 N4 vend) X9 m% z- Q' a* X- M

# w0 F( e9 \7 q2 Z9 X( ~) I$ R: Y" nbegin P_induction arriving7 j3 l& A0 S0 ~
    if A_induct=1 then clone 1 load to P_pick1+ y7 O0 k' X% ~: C6 N, v3 \
    else if A_induct=2 then clone 1 load to P_pick27 ]9 ]! |5 L- [8 L2 B
        else clone 1 load to P_pick3* O$ l7 ^* F8 V4 o+ M  z3 a" j
end& L( ~0 Q, @( L

; ]! U8 u+ z% e" B/ L" G- `) dbegin P_pick1 arriving
+ C; q% r" p1 R    set A_i to 1
; [+ G# c3 H" w    move into Q_induct1- z- g1 i5 x" f1 Y
    move into pickaisle.induct16 d2 I) M" ~2 ]+ N
    while A_i<=30 do begin! [: {0 C+ ]1 C' w! M) o
        travel to pickaisle.con(A_i)
  L/ B, H# S% ^) e% D% r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( Y, h& u& b# P1 ?        else wait for 10 sec% I- L, I$ e3 m; [- d, A! z
        if A_i=A_leave then send to die' Q( g2 B$ |1 U
        else inc A_i by 1
( |  ^& r5 n$ @' A- K# A% K4 C" t" Z    end: E' X  k+ q: f- w; h/ f
end  p7 W, t- v- }) X) [
7 u& K  q5 c0 Q- X$ o1 `
begin P_pick2 arriving4 ^1 Z+ ^) q7 q( c6 y& L
    set A_i to 11
8 }1 B  Q+ I% u: o/ P( A    move into Q_induct2
6 E% c7 W& w, T    move into pickaisle.induct2
' a5 ?- x4 _5 Y: f9 k0 \    while A_i<=30 do begin+ a7 b7 l2 u+ K1 p* c
        travel to pickaisle.con(A_i)
+ [  c& `9 O% a9 s& z2 P9 o/ G8 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# f9 M4 q7 Y, z* ^- ~' `, I+ u
        else wait for 10 sec5 V( k2 y3 e* E8 X  S
        if A_i=A_leave then send to die7 h+ z' d4 c+ u" H5 J" b( [3 t/ X
        else inc A_i by 1- e" {3 X8 K7 u' g1 `
    end
8 q# h5 Q1 b4 K: m/ R3 e; H# vend+ E# O1 A9 N4 q8 h

* O2 |& f3 a: a# f: Dbegin P_pick3 arriving6 F8 n$ O) h, f1 V5 Q" o1 c3 u9 F
    set A_i to 21
* h" i& r: F' Z( K    move into Q_induct3
' n9 H* e" T6 s    move into pickaisle.induct3
5 t% P2 l9 c6 Y/ `0 q    while A_i<=30 do begin
3 E9 k, H$ ^3 S: t) r+ {        travel to pickaisle.con(A_i)% M6 C6 c2 W% c$ S% P9 Z' _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 H" W$ V3 Q* m8 |( S& ~7 Y        else wait for 10 sec
1 {7 U% p# J: P! Q        if A_i=A_leave then send to die7 i% W2 U/ g3 n" g2 ^: j
        else inc A_i by 1) U/ i7 F5 K" G
    end% |( @% r* V2 R( E) T
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是个什么东东?
1 ?( A8 ^' s, F2 {+ I2 i% b+ qmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# X8 L, k. L' Z: ]6 I- w: w! q
0 A1 S! G0 N- {AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: w% [4 h: A1 g2 ?( r" J' ?
+ l% M  p3 |& S0 W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ i9 e* W, l; A. b- s8 m  x0 x
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( z7 S/ x' A  ~- k9 a" e( ?4 W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ }: I' N$ N9 p6 i1 m" [6 [! c/ ~
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& I6 k. a0 ^! ~4 n. I' r& I4 ?* }begin P_induction arriving
# O2 M9 Q8 F1 h& c; o  l) q  [    clone 1 load to P_pick(A_induct)5 H% L. {2 @& |7 m9 h9 |+ t
end最大的系
: H, E( O$ e0 ]5 J* }( N* S# F* W$ B, R4 }$ Z0 h
begin P_pick arriving  ?* g( ]& F5 H$ @5 t) T
    set A_i to procindex * 10 + 16 y. }: A) |7 |/ z# m7 I; b4 l
    move into Q_induct(procindex)7 R- L8 k/ r6 @
    move into pickaisle.induct(procindex)
+ j# o5 d- y8 w$ H& F9 H' Y    /*check the type of pickaisle.induct(i), for your last problem.*/
& Y: O/ Q( F6 R9 w
! o4 Z( ]# z8 b- t    while A_i<=30 do begin
+ ~4 S$ v& M7 C$ A# `/ C        travel to pickaisle.con(A_i)7 Y) }7 E5 ~4 T6 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 K( y, a$ L3 [. p) n; p        else wait for 10 sec9 ]  h7 {4 Z6 M+ ^% N0 Q% Q
        if A_i=A_leave then send to die' c; A* l! z) |
        else inc A_i by 1( C! V, h+ c; U: m7 y
    end
* h1 Q1 h( T2 {7 p" e3 xend
- p4 S0 y0 z" I5 r
9 R8 R! g0 R& P* I) l其中的procindex为整形,代表当前process的序号。1 P: F( l+ l0 W, B
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-5-19 07:52 , Processed in 0.017215 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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