设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14190|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. j3 C1 q- q& F7 P& m6 ?/ S0 s$ q+ Y; W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 R3 _: Y6 d( g% e
! Y2 s9 H! p4 K$ L, Gbegin P_read arriving' ^/ k. d; v! o3 R) @
    while 1=1 do begin! O3 i+ o# P/ x2 a6 f/ H
        read A_tote from "data.txt" with delimiter "\n"
# V5 f1 K; c& r( p3 K        read A_time from "data.txt" with delimiter "\n", c3 ~8 N# `$ ~3 F9 A
        read A_leave from "data.txt" with delimiter "\n"
2 K- G6 ~* |: U$ L' S        read A_picks from "data.txt" with delimiter "\n", S& Y3 W+ T/ A3 L
        set load type to A_tote
* J- Z: ]% u$ [+ i( {3 A. t" D8 x1 ~        if A_tote="tote 1" then set A_induct to 1
7 l) ~$ g+ a* ?4 _        else if A_tote="tote 2" then set A_induct to 2
7 K2 c* x3 \# @3 c3 o4 p) |9 q$ ~            else set A_induct to 3   
7 U1 Y* v# R/ Q! O8 a2 h6 t        set A_i to 0
1 ?6 R% z1 S- ]' F        clone 1 load to P_induction
* r  n/ }( R7 }+ a, W. _        wait for A_time sec& J# L& d9 g, T
    end
( O8 {5 E- ^  i$ h# l" c8 {end
8 q5 h! N, A5 W7 B
6 _: m( \, t& ]/ F$ zbegin P_induction arriving& S0 S. _* l; \5 ]4 R) b) S8 Z* r
    if A_induct=1 then clone 1 load to P_pick1/ C. s& |: x: s6 O7 P8 u
    else if A_induct=2 then clone 1 load to P_pick2
3 N- G: [, _. \$ G- A' K. S' ~        else clone 1 load to P_pick3
) @2 x; G6 S# i2 [4 I2 H; G" Wend
6 Y( G# l* R+ d2 c  C+ Q
8 w5 Y( r( p6 p2 n1 Wbegin P_pick1 arriving
& O  H* z4 k7 S. }6 P- e: L: C- N2 z    set A_i to 1
+ h" o# c1 A2 p1 ^) _& e1 m    move into Q_induct12 j3 a# f3 s! l! F
    move into pickaisle.induct1
0 ]; }1 h+ A* C& ]    while A_i<=30 do begin
. Q  n( X) i& {8 B* f        travel to pickaisle.con(A_i)5 t! n; g/ c& \4 s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 l, P6 k+ A0 u% w4 A) k        else wait for 10 sec
4 t( M& \/ ]5 Q1 }( k9 {  x        if A_i=A_leave then send to die
" [/ @5 A( p7 b, S5 |& ^, p  N# Q        else inc A_i by 1
3 T% V8 j! W0 N1 Y    end) h* m( J  M! q, S7 W  O; Y5 }
end
. |3 V+ B  a: K' \2 |5 H( o) k6 ?- u
1 }, ~9 W* D% d6 xbegin P_pick2 arriving3 I% ?2 _' s% k* c8 s
    set A_i to 118 \9 ^3 e! R: k+ j; s; P
    move into Q_induct2' y# a4 ]# S4 h, w
    move into pickaisle.induct2% d3 i5 \) m. b9 Z! B7 d  P
    while A_i<=30 do begin
6 S  |9 b) r' ^        travel to pickaisle.con(A_i)
- [. B) t# X+ h5 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% Q& V  _0 L* X( m
        else wait for 10 sec
$ W& v. u+ W2 j        if A_i=A_leave then send to die
+ r2 a/ [( R6 `2 `1 ~, I        else inc A_i by 1( N3 h) r  d4 ]: S9 n+ r' |% K
    end" P, e% `7 H8 Q$ ?
end( P5 L+ ~9 w; T( D+ d3 s5 g! p

9 a3 B# g+ `* W  Xbegin P_pick3 arriving# [  Y* A* Q8 d
    set A_i to 21( q. V3 x& |- W$ ~/ P3 P
    move into Q_induct3) `( V; C) ], Z! R/ o& S
    move into pickaisle.induct30 H% ]' n$ a* _# Y, o5 y
    while A_i<=30 do begin
9 V) x, z( j/ u: l- ?6 E        travel to pickaisle.con(A_i)3 s; H  s/ p: R3 ?6 h+ a8 \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 M. ], X* U% B1 [        else wait for 10 sec
: H7 ~( B. b9 i, Y# x        if A_i=A_leave then send to die" |' r* H7 g" r8 Q; \" y6 l
        else inc A_i by 1
" m) h3 U% l! h+ W: F7 \' x' u9 ^    end
" N( h) \, k) r% r  Jend

最佳答案

查看完整内容

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是个什么东东?
' A; D2 [/ S  r9 @( Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ v. ?3 |( V0 ^8 z. V& V$ Y8 l
' ~9 `- |! K! d4 F3 OAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! h5 b' b+ E$ z5 _3 t
4 p# R6 b2 I- |. h3 M# A
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 V2 }& K/ z, y( r- V) o& p
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) F2 Z  ^8 u) s% p5 t$ N6 A4 f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! d; [( {, X' P. @. k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( B" K9 X1 i! s. z- J  W0 gbegin P_induction arriving4 D, ?1 C" @( W
    clone 1 load to P_pick(A_induct)
, U6 Q  Q$ Z- ~: V  D2 V7 s2 U! hend最大的系
" q8 y7 E' ^" e- T8 }
+ ^/ G% z# ~9 `begin P_pick arriving6 P  Z' b4 _( M4 ^+ j; F7 r  N5 D
    set A_i to procindex * 10 + 1
5 U6 e6 y  ^) `    move into Q_induct(procindex)3 I8 t9 h0 t: w; p7 j
    move into pickaisle.induct(procindex): S4 o! A7 K9 t3 w
    /*check the type of pickaisle.induct(i), for your last problem.*/
0 c" C, E, V# M! V/ c
, @1 M4 n6 k1 N( Y& y! F    while A_i<=30 do begin
; h& o- N! {; c% R9 t        travel to pickaisle.con(A_i)
9 `1 T9 O' ]' S* f1 }9 a% R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ v# I3 Q1 a' {6 H2 s& f        else wait for 10 sec9 V. K; z' r% K8 q) ?- q8 I
        if A_i=A_leave then send to die
- \% l8 D, E6 {$ L: j4 _3 l        else inc A_i by 10 v7 P+ K; n. ~, y, r8 v" M- U
    end
8 Z6 K- v5 \3 i/ h: {- T' @+ oend
0 `* Z5 j# l& U* j: z6 l4 J8 \9 e; A3 P+ t& c* w+ I. M2 s3 c6 Z5 B
其中的procindex为整形,代表当前process的序号。
& C0 p5 y* b, `: f6 X! u& 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, 2026-6-18 15:56 , Processed in 0.014829 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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