设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12649|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 e3 t, o2 _& _" Q9 O
* n# T/ x0 f' u' F1 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中的数值,不知道会不会有什么不妥。
0 F3 _5 w% [" g* c. B; f: B8 M* S3 g* r: S' i& Z* A
begin P_read arriving
1 Z& r# k7 o* q) F) C3 J    while 1=1 do begin
) X$ `! R1 r, Z( f8 E6 I        read A_tote from "data.txt" with delimiter "\n"
2 N  k" R6 H6 K  Q4 D! x        read A_time from "data.txt" with delimiter "\n"
, Z9 {' M9 o+ v        read A_leave from "data.txt" with delimiter "\n"0 X$ X- Y2 F) l
        read A_picks from "data.txt" with delimiter "\n"- \9 N/ f5 t+ D% z* q: W
        set load type to A_tote: }" ?- |; q! F: l& H  ]; h
        if A_tote="tote 1" then set A_induct to 1
: T- p- N& _( X8 @* `. Y        else if A_tote="tote 2" then set A_induct to 2) `7 T7 y5 |( V  t/ l4 G) S
            else set A_induct to 3   
. Y5 ^4 d) w4 V4 y' T+ }4 I        set A_i to 04 N/ O3 H+ S9 ?5 y  b
        clone 1 load to P_induction3 m) G5 {2 [1 v
        wait for A_time sec
& k, h. j: k& r    end1 u! _+ B! M$ X, m4 e0 o0 q* K
end
3 b1 p( a( N! g# I; \& f1 u
/ u1 {3 H6 a$ r5 Pbegin P_induction arriving9 h) I/ q' V% O) O7 h0 Z, X
    if A_induct=1 then clone 1 load to P_pick1$ g) d# X& C; H" o! ^( F% Y8 {
    else if A_induct=2 then clone 1 load to P_pick2
6 T7 b' e/ m9 C9 p        else clone 1 load to P_pick31 Q6 f3 C' L" C8 c) k6 m
end, X, c6 ~5 R; \& n& i  O2 P7 }3 t

1 g5 A; }3 S5 K# {3 w. M$ Lbegin P_pick1 arriving
5 S# _' c7 X4 k& B    set A_i to 14 @4 u: i5 U, L- e% j( a
    move into Q_induct1
  P7 [! `- z* s. P, f6 ^    move into pickaisle.induct1
# ~! X% M# W5 T& A- N    while A_i<=30 do begin1 n) Q3 L7 n' Y7 k6 M" C
        travel to pickaisle.con(A_i)' j$ ^& ^- y. L% b" g2 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 l" C. R0 U- f' E! H
        else wait for 10 sec
& ^7 c/ I: p' a5 R: P% N& l        if A_i=A_leave then send to die- }9 v) O9 d. n- t2 Z7 T8 B
        else inc A_i by 1. `! n# h9 ^; ?( x  N& E
    end
; X; Y7 {; u2 w# @/ \3 t1 Wend
( {5 T/ g2 o5 r- B2 n. W' h, j' L+ {, J1 q
begin P_pick2 arriving2 W) V$ W( K, ~0 F
    set A_i to 11/ C2 t/ o7 ^8 F9 b) G
    move into Q_induct2
' L# I6 `( Y8 Y) X- }8 i3 c    move into pickaisle.induct2
( [# u1 Y' q. R2 D4 V. p    while A_i<=30 do begin
, {& L  P& T# P- U        travel to pickaisle.con(A_i)* {* \; r0 V1 C: Y0 S8 j, I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: l4 ^+ w+ b2 `9 `5 L: e5 E
        else wait for 10 sec- n6 F. t! g( @; Z2 M+ j1 X/ Q/ U
        if A_i=A_leave then send to die
/ K0 W( B. c* V3 g        else inc A_i by 13 F& {7 K; h: [3 W" w4 L, p2 t( G
    end
2 Y$ f6 z. h! D; O  z& pend
, v. A4 T2 F  r# T8 m1 K& p" G9 W, V: G( @- {8 f0 g6 f
begin P_pick3 arriving) |& {& E" L; r; ?4 Y6 d
    set A_i to 21
  f( [5 K1 T: m2 v$ S, k4 A0 n9 \    move into Q_induct3
: _2 Z4 |  O- N2 z* t- ]: E    move into pickaisle.induct3, h/ R% @# m, K( P2 L& Q% \* k. I% `
    while A_i<=30 do begin
6 |7 o7 I/ G8 h+ |1 @# |+ z5 E        travel to pickaisle.con(A_i)
! ?$ Z/ v  O( ?1 Z6 H1 L2 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) \* ~; K9 A' o9 f' h        else wait for 10 sec
! L/ M7 d( T# i. i) `6 R        if A_i=A_leave then send to die
( a9 x/ A; f0 {1 Z- x( `        else inc A_i by 1/ y1 P7 |. L  j
    end6 R7 h: j: Y% ~+ `' B
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是个什么东东?
' R. w7 T, O) d  I1 g3 \move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ ?2 K$ V+ C  l* R. }* s: N% x
0 G& b" r: M4 P* E1 A0 Q' _. JAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ h! @1 r- k$ z' z& [
) E# `2 J9 ^% D7 Q+ J6 `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% L% t0 y" `. j3 \5 K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' C1 i5 ]" b3 }& d5 b$ l2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& ?# g2 q2 g; `, N, Y" M5 f& {. |
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 `7 c+ m+ g# w6 G# s: p
begin P_induction arriving
0 x, W* \6 r5 a  z  q' H# `    clone 1 load to P_pick(A_induct)
0 J6 V. [) K8 z, Jend最大的系
4 R+ l+ P% k8 @% d
4 I" F* y( j" m  T& O  W* Ybegin P_pick arriving, u# V0 p/ U/ o' ?" H6 w0 N8 y
    set A_i to procindex * 10 + 1
9 s" h6 y# }: G; ?7 u) v2 Z    move into Q_induct(procindex)
/ K3 L  Q8 o! f0 {    move into pickaisle.induct(procindex)- V1 a( [/ ~# R/ C2 |+ t; v* y
    /*check the type of pickaisle.induct(i), for your last problem.*/. B5 q' f1 G) i0 J" h* Z9 A
% d! i. }) l3 o" D- r
    while A_i<=30 do begin0 k6 ^5 H( T- w) a' [. ^
        travel to pickaisle.con(A_i)1 U0 \4 ^1 F* {% v. G3 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 t! D% [0 v# R1 O% x+ u: l
        else wait for 10 sec# Q0 v9 B% p8 Z2 G/ ]9 z, Q/ ]( W
        if A_i=A_leave then send to die
3 N! w# X# w! v! s2 Y4 a        else inc A_i by 1$ e% p0 X# u; X# A' v! m' v2 ?$ g/ _
    end, \) r" @) `( B6 l# w" o5 g
end5 u" ?* Y+ z; Z6 [; Q9 Z: M7 s- y. V% d
, ?: `! P9 t* f$ q8 t7 L
其中的procindex为整形,代表当前process的序号。
% ?: h# q2 v  N: F2 \9 K6 Mstation和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-8 03:33 , Processed in 0.019717 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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