设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12799|回复: 2

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

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

5 i1 I7 m- c  o7 D9 ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, x  A1 `; W. o9 X* p  \9 G8 w& H$ A  Y7 c
begin P_read arriving
3 V$ k5 B6 Y6 N& ~    while 1=1 do begin
1 f" x4 _9 ~: A5 b6 Y- `        read A_tote from "data.txt" with delimiter "\n"
/ v0 _9 {. Q& }; _$ O        read A_time from "data.txt" with delimiter "\n"
6 j5 X: H: C1 n- Y! s5 A6 O        read A_leave from "data.txt" with delimiter "\n"
" c: ?" A) s# y0 e: `  N. ]        read A_picks from "data.txt" with delimiter "\n", ]# V. N) G2 b+ _' n0 U, J" f8 T
        set load type to A_tote: ?+ ]4 S6 x8 G' S
        if A_tote="tote 1" then set A_induct to 1
& e5 U1 ?2 b8 f; K" ]2 R        else if A_tote="tote 2" then set A_induct to 2, _/ F" F, F; N& ~! M
            else set A_induct to 3   
1 i7 z4 P  T' H        set A_i to 0
' \  J5 Z8 b1 m        clone 1 load to P_induction
; g5 e. A7 y5 N  G& E: \- d8 a! D        wait for A_time sec
+ \! v! o* @+ u$ N% n' l4 o% c    end
7 L. J9 ~# ~( eend
0 B, C3 c1 U& n3 _' p
( h' [2 S' E* {5 ^* Lbegin P_induction arriving
* _* Z$ a8 L, D! R& t! Q! ^    if A_induct=1 then clone 1 load to P_pick1, Y1 g' O' q: ~- Z7 x. F
    else if A_induct=2 then clone 1 load to P_pick2
% W: W, C4 g; Y: r        else clone 1 load to P_pick3
0 U. H2 k! Y1 X. M( }end9 p7 m5 u5 P7 x; X
/ b6 G( Z3 p" ~( O5 Z+ z$ y
begin P_pick1 arriving
, }1 Q% C& u7 {1 ^: A    set A_i to 1. Z0 S6 J/ _- J
    move into Q_induct1% c5 s& e) W( s# Q& [6 B6 Z
    move into pickaisle.induct1
  z4 \/ e+ Z  D% N    while A_i<=30 do begin
7 y/ B4 V) l$ C5 P8 F7 s% l        travel to pickaisle.con(A_i)4 M! n' ]9 u1 r5 J6 ^( Y0 k7 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* p4 ]8 e( J$ g; {+ A& R        else wait for 10 sec6 x+ k* \2 R& s& \' y: n
        if A_i=A_leave then send to die  g4 ~! L; a3 @- f5 y4 o+ ~
        else inc A_i by 11 ?# `, k, L# ?. |. V
    end& s0 _0 j' L5 X2 j8 r5 ?. f; H
end
6 @6 _8 ]" [; {  N# D- |' u4 i9 M& C) o2 b# h7 }, b
begin P_pick2 arriving
( }4 m4 B8 u, c' C: m# O    set A_i to 11+ T: k  G# f4 y9 e  m- q& {
    move into Q_induct2
$ N. z* ?* r# l. u  O2 Y    move into pickaisle.induct2
' o( k' \- o, W6 k    while A_i<=30 do begin
0 R! c! V) {5 ^5 c9 q: m        travel to pickaisle.con(A_i)
- t5 e! }3 C! z# l. }! A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 c- }- U, l& p7 R1 d
        else wait for 10 sec
! u  E- {5 T7 j* E- b        if A_i=A_leave then send to die
5 H7 V' Z+ G+ s$ u8 G& \        else inc A_i by 1
! M2 J2 o1 |3 A& I" y- o/ r    end/ z. L2 i1 d6 M$ ~, R
end
  K% w. y8 A3 H$ `$ Q. t) K- K: }, o  F
begin P_pick3 arriving4 _0 ]4 {$ b  y5 b2 L! h
    set A_i to 21
, y4 |% ?% N8 T& s' u7 D    move into Q_induct3
; `4 p, X+ a, M- i    move into pickaisle.induct3& ^0 ^3 H% N: H* k% y
    while A_i<=30 do begin6 N% \. q! s. V7 w
        travel to pickaisle.con(A_i)7 H/ Q1 [+ w2 N$ M! I( F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 M6 [  W; U  z5 w; F) [$ U6 z! O
        else wait for 10 sec
) f4 [; k1 k* t        if A_i=A_leave then send to die
* b% c  F+ E# i: B6 p4 h. h        else inc A_i by 1; E  P9 y3 P4 X. X/ y! N* M
    end; Z. e/ I9 e; q( \; 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是个什么东东?9 b9 X$ F5 y/ `" r8 Q' d3 U/ _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# O: v% r8 t/ e) F( h# |% V

3 a- E$ f1 R! H6 O6 l. L5 O# ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; Y( k& H% D* Y7 t. j3 l/ B) {" x$ d  R- P5 v2 r4 s
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 j& o9 u: H1 W: y" Y5 d9 F1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ C  O3 H2 i% L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" i( [1 r' s4 t- Q; N6 }% Y  u8 H
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! t- F3 y7 ~; Q6 B
begin P_induction arriving3 T" j9 z  [: _) Q, i
    clone 1 load to P_pick(A_induct)
1 z* D+ ?; I% p( o7 l! t4 vend最大的系
4 q8 M3 V4 S( p* p6 x& Q
5 @4 _, ~! Y- a) Ebegin P_pick arriving
& L$ V2 I% n- M3 Z3 g3 S    set A_i to procindex * 10 + 1
- y, W# L  X2 Q* w    move into Q_induct(procindex)
! s3 @1 \* H# F: k    move into pickaisle.induct(procindex)7 l* z% P2 M( K0 o
    /*check the type of pickaisle.induct(i), for your last problem.*/2 J) d; B3 I4 |$ |3 q- r' F$ K& m  g+ Q

# I, Q$ n1 \6 d# J2 a6 G    while A_i<=30 do begin
& v2 x( v% g% n' e. D; j1 Y        travel to pickaisle.con(A_i)
/ J( t" J$ {% R5 ^" `+ J7 J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ?, n8 l9 v7 V% k4 R3 n. k! q# M  q8 K        else wait for 10 sec
$ L7 v) x8 a2 l        if A_i=A_leave then send to die% Z& d4 Q. m1 [0 j' @
        else inc A_i by 18 Y; Z0 k' Z4 R1 i: d4 `
    end. r" H1 N+ z9 S0 P$ l
end
" U! q* M  }$ {/ U5 u1 P- B
. A' ], B' s6 P4 y" S/ `7 {' E- v其中的procindex为整形,代表当前process的序号。1 s) N; D7 r2 d, ?) j% G. N" |
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-2-21 22:59 , Processed in 0.020922 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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