设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12033|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ O# {" f1 l- I; A& x3 |5 ]! p( e: ~$ E* t& T+ q# x
我的问题是,在每个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 w- k' a3 B$ F3 E, L- D/ x* P' }
& I* Z3 I+ ?+ c1 G! A
begin P_read arriving
9 K$ Q2 A& N, j* Z& X0 {    while 1=1 do begin
0 ~1 H2 w$ A6 W        read A_tote from "data.txt" with delimiter "\n"9 Y* A. w/ [4 _2 g+ o
        read A_time from "data.txt" with delimiter "\n"
, V% m( Z5 z, r        read A_leave from "data.txt" with delimiter "\n". {4 p. Q$ c% ~4 u& K
        read A_picks from "data.txt" with delimiter "\n"
' t. o, Q1 ?* Q, C/ Z        set load type to A_tote, m+ u9 q5 Q/ N+ v
        if A_tote="tote 1" then set A_induct to 1
: p/ ]) J) |. i2 o0 _        else if A_tote="tote 2" then set A_induct to 24 K* X) @& _, d4 |: @8 U4 P
            else set A_induct to 3   
5 k# j% x0 C- F3 n; k2 r        set A_i to 0
) Q8 b, O% l' \% I& W        clone 1 load to P_induction
3 R) N; n3 Y+ s+ i6 \+ T( ]        wait for A_time sec3 `2 y. D) I. S, G$ i( K
    end
4 r; b0 ^+ R/ g- \+ u( Hend
9 k& o1 J7 U) V. \4 }! T7 X+ s
, U2 V! s8 V* b3 j# G1 a7 Ebegin P_induction arriving
2 _& A* C! _" U0 i( L( g. j( T    if A_induct=1 then clone 1 load to P_pick1. D. w  k0 \, b2 A
    else if A_induct=2 then clone 1 load to P_pick2& E6 A9 c- u1 v) Q4 k
        else clone 1 load to P_pick38 Q' }4 w/ \. @5 d. q) e$ ~0 Y( ]
end) k! F( S9 S# y! z2 O, a! j$ |

2 M: J4 G0 [% [4 A+ j* F1 fbegin P_pick1 arriving- p' l  G4 T1 b7 @
    set A_i to 1& V+ Q" C8 a- s, u( y
    move into Q_induct1
% K/ `! `+ B1 ~: @+ K    move into pickaisle.induct1
" `( }8 s& ?2 D3 O# \    while A_i<=30 do begin
; l. v1 f( G. `* P) Z        travel to pickaisle.con(A_i)5 C! U7 j: d- @: J) r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ N' B" k1 Z- g/ a. ?$ I        else wait for 10 sec
7 U8 b9 H9 q5 D        if A_i=A_leave then send to die
7 Q& ?2 H) e3 ~9 [& C        else inc A_i by 1
9 J5 A9 E; E  }$ b$ O    end' O9 f8 T# A& \$ l5 [
end
; _* K1 H% Z+ ^" v9 ^) i9 c: s7 T' z9 O
begin P_pick2 arriving
" z5 |( M) T/ T; B/ U3 J4 W    set A_i to 11
5 X- g) A4 m+ m8 t: w' t    move into Q_induct2
, k8 C! \$ w$ K  u* k# ^    move into pickaisle.induct26 U9 B* w( P/ n5 A* T
    while A_i<=30 do begin, n0 P/ x  G- f$ C% P: n1 Y
        travel to pickaisle.con(A_i)
: J9 X. `3 m# [9 t& f, d0 H7 M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) R# Q7 X: O, z$ Y
        else wait for 10 sec1 U, v; {8 ~! w
        if A_i=A_leave then send to die
6 Y$ [5 g7 Z5 @& J5 N; h        else inc A_i by 1
' [1 T1 L* n% f    end
; d9 h& K$ a9 w' Dend" ]' `0 q  z- j* C% Q* o0 `
& L* ]$ @" e* s% r- j: z
begin P_pick3 arriving. y  u6 ?' |6 B1 O0 H
    set A_i to 21
; ]4 r" O$ I" X; n& U2 x. E( i    move into Q_induct3
8 R8 K3 K  D, i& v5 k' a! x: d$ t    move into pickaisle.induct3
8 ]9 o) A6 r9 ]' H    while A_i<=30 do begin
" |' L7 H, z8 L        travel to pickaisle.con(A_i)
. I; M* j( Y7 H7 O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 p9 h' h. S; r8 V
        else wait for 10 sec
+ F6 J+ v, I1 K: w        if A_i=A_leave then send to die0 Y% Z( F( r" i( J
        else inc A_i by 1
& R% o) ^7 r9 y2 ]    end
/ c: a9 J2 o( g: J: f- x% Nend

最佳答案

查看完整内容

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 w* x  ]" e$ L1 }- V( }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" }: b& u( S8 r

4 Z& @2 }; f0 S% U  MAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. Q/ T4 ~, |( X
6 I' Z; A  D7 H
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% U+ W! }2 n3 G9 u. t; h1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! c) r) L+ F$ Z7 r2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ a5 w6 a  x. ]; l3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 h6 T# ~/ G& l/ `/ B; Mbegin P_induction arriving
2 a" J- X/ y2 O3 v7 c    clone 1 load to P_pick(A_induct)
% \- b* V6 D) d$ O" mend最大的系
' s* y5 y" v& P! P# D% p- E: N$ s  I. B9 j' z0 E1 v1 Q
begin P_pick arriving, H. O* b: y" V; r6 u1 u% Z0 G
    set A_i to procindex * 10 + 1" J, e: ~+ W$ @! |! d. d
    move into Q_induct(procindex)8 e2 n, a: r3 l' I: G  m
    move into pickaisle.induct(procindex)
# Z* j% W) X) |% g6 u    /*check the type of pickaisle.induct(i), for your last problem.*/
: h. T# T3 U9 ^" r: x
1 j* n5 w. E6 `6 |& D    while A_i<=30 do begin7 h- n3 z/ K, A& I/ N
        travel to pickaisle.con(A_i)! M3 G' U; g- \* A: g3 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# K' ?# Z+ e* G. q. V( t
        else wait for 10 sec
/ u- R3 v: g, x0 F& S& l. Z        if A_i=A_leave then send to die4 `3 B8 [6 i. `8 }
        else inc A_i by 1
) M: W9 ]% ?* k( i' k/ o    end" V$ U- H+ \- O/ _
end
: I. n+ m8 m, a4 x6 y  q
* Q. Y6 Z" H/ x7 K4 \1 @: O8 g其中的procindex为整形,代表当前process的序号。
. V6 R- s% ^: f3 Dstation和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-12-23 00:54 , Processed in 0.017562 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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