设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14302|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% j& [: B$ e+ F* z1 Q2 I) R# j, l$ i* 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中的数值,不知道会不会有什么不妥。
. F$ D; N- P4 \9 z$ ^8 ~1 A& P* m3 {, e9 C: |
begin P_read arriving+ w4 c" s' W5 y% Z- K% U- X
    while 1=1 do begin
9 M0 G0 w0 W; d$ B! R6 M  F7 ]        read A_tote from "data.txt" with delimiter "\n"7 P/ W, L- X, o
        read A_time from "data.txt" with delimiter "\n"
( F) q# i* W/ T3 W        read A_leave from "data.txt" with delimiter "\n"$ w, D4 g  A0 f) j* R
        read A_picks from "data.txt" with delimiter "\n"
+ ~1 n" i* ^% C3 ~, _        set load type to A_tote* {1 d/ J8 M; e4 }7 m2 d  L
        if A_tote="tote 1" then set A_induct to 13 o' E7 m' ]; o* m  n: _
        else if A_tote="tote 2" then set A_induct to 25 |2 J7 w) e) N
            else set A_induct to 3    % n2 y$ B- u8 Q/ q
        set A_i to 01 p  }* P; t8 m+ C
        clone 1 load to P_induction# H; V  z; O2 @& R2 x. M% d
        wait for A_time sec
& F- n$ {. c9 t1 d    end
' W# E" p% u. x1 V& H) g- \1 Rend
+ [5 b2 ?0 R% V) |$ s$ s. e* a. }7 _1 n6 Z1 ~
begin P_induction arriving
$ v! o+ H# |: u9 O7 ~7 d1 K    if A_induct=1 then clone 1 load to P_pick1
" {9 ], [) |4 I& ]    else if A_induct=2 then clone 1 load to P_pick2
% q% Y% k7 b3 ]) a: A* }& g        else clone 1 load to P_pick3/ P% |* ]4 a: O' W1 C1 X+ `. [! w
end/ F& V3 B  L8 J4 |! X1 V. {
4 K3 D3 x: t0 p* q6 A1 O) K; n
begin P_pick1 arriving6 G' S" j! U& z+ z9 H" P7 T
    set A_i to 1
3 P/ @+ ]  O  ~$ Q    move into Q_induct1% _- V" J; M, w% F& T& G
    move into pickaisle.induct1
1 [% l5 Q! l2 I9 T0 w' p    while A_i<=30 do begin+ y6 Q( Z  W, {' @9 x) [
        travel to pickaisle.con(A_i)
. |: v5 L  b& m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" H' x% k& T1 ]/ f9 k- H* K: N
        else wait for 10 sec/ W: ^; Z* v, R$ O; [7 ?
        if A_i=A_leave then send to die* b: D2 o" v. `, O1 v: E6 |
        else inc A_i by 1% G$ I" [5 r& m' [. s; t
    end
* q# S3 f: _6 A- R! Pend
9 X( _( P! Y5 s8 }0 d# y- d2 l- S% \9 t# `' G4 d) G' z& U; ]
begin P_pick2 arriving4 b9 l* g8 ?, C" W) C! j9 x
    set A_i to 112 g% K8 |/ H3 T. Y# |: O
    move into Q_induct2' \7 Y) O3 K& H0 Q. d
    move into pickaisle.induct2) U6 A: o' U* N
    while A_i<=30 do begin6 X& D" j: @/ N3 v) C' n4 K' x
        travel to pickaisle.con(A_i)
. F  u, H: d" B, }3 t4 o1 A+ k0 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) o" U; v! H, s( g        else wait for 10 sec# N3 Q* V) t8 c* j* \. i1 E: u- C
        if A_i=A_leave then send to die
- t; S. C+ {& q3 G* ?1 Y        else inc A_i by 1
9 l5 x. g- f/ @  L5 t    end1 T- ]4 E/ l1 S
end  A2 C* Q6 {3 |) ?3 J1 l9 x5 X
9 [5 [$ O2 O; Z, ~8 d. f/ \
begin P_pick3 arriving
% k, K3 R- q5 W+ {0 F, o    set A_i to 211 L% }$ d* H' ^
    move into Q_induct3
0 |5 o+ W0 p4 s    move into pickaisle.induct3! Q. ]3 H% Y( d( J8 L- W/ v3 E3 m
    while A_i<=30 do begin
) {+ I& M. K8 l8 E3 G0 n$ U        travel to pickaisle.con(A_i)6 q5 c1 q* ^2 @3 u2 h' D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  c, c! h4 l+ b4 g5 k5 _/ E$ {6 T+ u% E
        else wait for 10 sec
% Y" D# {9 G( N* B8 C; K        if A_i=A_leave then send to die: U, Y- ~% a# A% F  e
        else inc A_i by 1
. G2 g  p: P9 x$ h- I7 P    end# E$ u  Z1 C9 ~5 H; q$ M
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是个什么东东?
, T' }  B" I  k3 I$ Gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. F! r3 G2 M) d' D' V9 a! G4 ~% W: {2 x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ R  M( p: p: a% g& a, l

" i& c+ I  \: G$ i, v' d6 h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% A2 e2 V" }7 I
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 g7 W+ B  r- O" r8 r6 T; v1 w8 e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 E# M% M6 J5 a+ |. P% g+ D/ F
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ `: N* q/ }0 h8 Xbegin P_induction arriving2 j8 a# J% U) k
    clone 1 load to P_pick(A_induct)$ _/ ?' _1 m' f, ^
end最大的系
$ ^" l' i0 W$ Z( G* h! u* ^8 r0 ~% _/ Y( }$ a4 ~; T5 H
begin P_pick arriving: l) T% s3 x! V# [7 g0 C
    set A_i to procindex * 10 + 1+ R7 e& E( [: ?" d, q
    move into Q_induct(procindex)
, m! ?+ \# ~* o( x/ x% J8 E    move into pickaisle.induct(procindex)
+ P' w; B4 x- |& [    /*check the type of pickaisle.induct(i), for your last problem.*/
2 T! I: ]; L# @1 f. m. G/ T. P7 ^# J' D$ M* O
    while A_i<=30 do begin! {/ K% i/ r1 h, F3 j6 [) z
        travel to pickaisle.con(A_i)
& h' A  R  N; c* L/ s! G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( c5 c) F# b+ z% S9 h: p5 a
        else wait for 10 sec& H8 q2 y$ g0 q7 j) ~$ B
        if A_i=A_leave then send to die
& j9 M  I( x; ~" O! F2 f& b/ E        else inc A_i by 1
9 v* |( G8 b: N% q; ~. `& @    end+ a. r" G6 H0 h
end% u" _% E6 O! ~3 n' x
2 s/ N' E& Q/ E. ^4 p
其中的procindex为整形,代表当前process的序号。: K* p" _/ R) ]% q9 l) I- _
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-6-30 01:51 , Processed in 0.016079 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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