设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15030|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! f( ]( K# Z* A' I2 N& c  [/ Z5 A
; x. J: Y2 f( B* k3 k' O我的问题是,在每个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 L* x3 S) p- |0 U+ V2 U* ?6 d, ?( M1 {% h; F8 }" c; v6 B7 X
begin P_read arriving
8 @! d3 ]+ a/ `' f    while 1=1 do begin
0 P' U7 s. I/ d: Q3 d        read A_tote from "data.txt" with delimiter "\n"
8 _) n/ s8 d4 E" p/ j/ l        read A_time from "data.txt" with delimiter "\n"3 s5 N9 b' }" a3 z/ _# F/ I
        read A_leave from "data.txt" with delimiter "\n"! s- d0 d: {, o3 V2 o$ j# \7 `
        read A_picks from "data.txt" with delimiter "\n"3 `9 A& @8 z0 D# b) \4 k  R& ^9 ~
        set load type to A_tote
1 N8 R7 Q& J+ {1 F. b        if A_tote="tote 1" then set A_induct to 1
9 R7 H7 E# S6 N% {9 _" X; S% Z        else if A_tote="tote 2" then set A_induct to 22 O/ R: v* Z0 Z; t( `
            else set A_induct to 3   
1 i6 C, N: c; ?, a& z, x( n        set A_i to 0
; {. y* f2 A- q% d" X+ r. O        clone 1 load to P_induction
0 J1 i' I+ R4 K* o        wait for A_time sec: l5 N2 |- \: V- }
    end
. S* c: `" Q9 N9 Q- ^end" I! P& t+ C3 [4 Q

, q" L, [1 v2 U7 {$ [begin P_induction arriving- p/ ~$ t6 a1 o9 F6 F4 {. Z
    if A_induct=1 then clone 1 load to P_pick1
6 N, D5 q; D# s    else if A_induct=2 then clone 1 load to P_pick2
! c( L4 ?& c1 _+ x        else clone 1 load to P_pick3  h' d- V; P- _+ M  M3 a
end
) o- V; |: }) \8 y; f9 j6 P! l+ A7 Z2 A+ n* l
begin P_pick1 arriving
( A- }' x6 q' \6 a9 Q) j    set A_i to 1  R" m4 |4 v7 ~) u' A$ U* X8 P
    move into Q_induct1
& k9 u" y; d2 O% r! |9 n    move into pickaisle.induct1& i: W3 h: U$ \  g- n7 H
    while A_i<=30 do begin! T! u% u5 A. m8 e9 S
        travel to pickaisle.con(A_i)
% N" q% D( H4 A+ b8 s' V" z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ B6 F' q' F7 F9 D2 {" M9 R3 S
        else wait for 10 sec
" B* w+ j' Y- B* `8 H& z# V        if A_i=A_leave then send to die6 L& K5 C* S' g* Y
        else inc A_i by 1- z7 x5 l$ ]* U  G
    end8 A" [0 _2 |2 d8 s5 ^# C
end
9 q2 I/ ^  q, t
4 u- n# E, n7 s* A0 F+ n0 y9 M/ _begin P_pick2 arriving
/ T$ Z# x& z3 f; h- O    set A_i to 112 {5 B. ]3 \, e2 y) z# e# d
    move into Q_induct2. i0 M: `# r/ h$ }: h9 _
    move into pickaisle.induct2" F$ \# x6 O( |2 ~. b
    while A_i<=30 do begin) i/ D5 s8 T) ]+ ?3 p
        travel to pickaisle.con(A_i)
! x0 l2 X0 ?" T/ _  V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( R1 ~% ^# d6 m; P, E! r
        else wait for 10 sec
* X$ I: h$ H( Y8 u8 W6 I# v        if A_i=A_leave then send to die
1 d. D& }  L. @5 X3 R, |        else inc A_i by 1' u( o8 ^5 X8 K
    end/ N, E+ W! X) J4 D
end
1 v9 D1 K+ G3 f% a4 A- C
; `3 r& `) w( w; s; E" g4 Z0 nbegin P_pick3 arriving
( c* B5 p, _5 b5 R4 a( y2 f% Y    set A_i to 21- P& k- \/ ?7 @" S# V6 ~* d
    move into Q_induct3
; t9 E$ o5 ^  J. ^0 v$ e7 {    move into pickaisle.induct3; E2 l* \$ V. x* E' {: _
    while A_i<=30 do begin8 x0 D' l' `/ g2 ?& m6 o
        travel to pickaisle.con(A_i)! R* a& L$ ]2 Z2 ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( a. y6 c: w% p" T2 B% o! s) k
        else wait for 10 sec
& W. p/ R' W+ q( s0 S& P  T9 c        if A_i=A_leave then send to die
$ G& X1 B1 a! V; X        else inc A_i by 1
  w7 M: c' [* a5 c. ^% Q* Y9 j3 z+ b    end
0 E! X6 z% P( H' b4 rend

最佳答案

查看完整内容

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是个什么东东?$ |. s3 u! W' g
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 c2 u. Q0 T$ D2 ^6 u4 k
' [9 P0 Z# M) j4 `5 y* l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 I5 h& x. _* x2 j4 n/ _2 o/ w
2 S6 M0 G; f( W) I" k, s+ z- Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 C8 o- X0 u6 P- z5 V" A% n! e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. `, U) j/ Q4 H, f7 H) x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;8 d9 |4 ]: B0 y8 r& Q( X$ g
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# C  C" m% X: b. u7 s0 zbegin P_induction arriving/ D8 c5 z- l/ ?. k7 e! W3 N3 m
    clone 1 load to P_pick(A_induct)
# X8 `3 }% ]/ h8 Mend最大的系
# _9 `8 G( h+ r, g) U5 o: m6 Q5 u  m
begin P_pick arriving
* e! V/ G0 h3 N- }# q# \    set A_i to procindex * 10 + 1% m4 M( `1 n: _% u
    move into Q_induct(procindex)
, a  E+ B: C+ E( d6 X7 o4 N: ~; c2 I    move into pickaisle.induct(procindex)
5 M( A+ f' _4 N+ \    /*check the type of pickaisle.induct(i), for your last problem.*/
4 d, j' b7 i  ]/ Z8 |4 f7 n; Z  e# P
) S# ?  g* H! \5 ~6 E    while A_i<=30 do begin4 ^- H4 U+ s7 `, H/ g6 P' A7 L
        travel to pickaisle.con(A_i)1 N) e& _; S* q0 @- o0 p. K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 K  E2 n) H/ [0 b- b0 E  L
        else wait for 10 sec
6 z0 V+ A4 ~* z2 a/ v        if A_i=A_leave then send to die, k/ w% G( \2 x* N4 ^' m  U
        else inc A_i by 15 i2 y+ l9 s) D: z
    end
$ B) J7 {1 Q& c9 F- G0 c( oend% h3 c1 h3 {7 \& C' U! B9 ^
" z4 i; @  ]& J" i+ K
其中的procindex为整形,代表当前process的序号。
) p7 ^7 X- P0 E. J3 W) Xstation和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-8-5 02:16 , Processed in 0.015187 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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