设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13416|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 I9 p3 E5 q2 A' I  l
6 p0 C# W* W2 L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 Z$ d- F6 N6 J+ h  m" S
! @) w! X: d; pbegin P_read arriving, C* Y/ @: {' M3 Q' |
    while 1=1 do begin8 M+ N2 B9 z' R6 L# P+ t
        read A_tote from "data.txt" with delimiter "\n": {8 b1 R' y1 h1 A6 @1 t9 n" J! m
        read A_time from "data.txt" with delimiter "\n"! x( R6 v& B. E( b( \0 u* m
        read A_leave from "data.txt" with delimiter "\n"" t( A3 q) x5 m4 [! e1 @8 P  u
        read A_picks from "data.txt" with delimiter "\n"4 o: n9 {' |$ ]2 G0 A  R2 I
        set load type to A_tote+ D7 }# E% ]* c$ z" @; M* f# X  y& t
        if A_tote="tote 1" then set A_induct to 1
8 G& Y* Z  U- y! w6 n        else if A_tote="tote 2" then set A_induct to 27 `, J( Q  l1 a( x6 `: U
            else set A_induct to 3    ; `* j# [, ^* f2 G
        set A_i to 07 R# V: H$ }1 f4 l6 q9 k; J0 a7 L
        clone 1 load to P_induction
+ |4 f( e2 U  G% e+ q% f2 Z. e% T        wait for A_time sec4 W3 R& u$ X+ M& Z( M. G& `
    end
* q' r0 K6 w6 c" Oend0 K# ^' z; j. D. r$ Q5 c" ?+ ]+ N' o
) n; r. m7 c; @
begin P_induction arriving5 D" G* M' h: P  n* m# k1 i* \
    if A_induct=1 then clone 1 load to P_pick15 j: e6 A4 P3 J" w- w" p
    else if A_induct=2 then clone 1 load to P_pick29 f& Q7 u6 j! m* z7 Y! ]7 n
        else clone 1 load to P_pick37 R$ |8 S% ^! l# q/ Y& t
end6 x* K4 Z- T5 a- e, Q+ r1 T+ D

+ r/ X$ T! [# M7 h* Xbegin P_pick1 arriving
2 y: B, q* ]+ K# g    set A_i to 1$ F' J3 ^& K; c
    move into Q_induct1
4 l* X* |- W% Q: i9 V% s+ D) m* y    move into pickaisle.induct1
. ?( o! v- ~7 \, Z* r2 k    while A_i<=30 do begin6 s% P) {) w# D! d
        travel to pickaisle.con(A_i); Y% x$ U( g( T+ Z" w, {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, H7 E/ P# e$ ]2 Q- V& B
        else wait for 10 sec
1 m3 p7 t+ P  x0 i        if A_i=A_leave then send to die
5 X  ^% L/ N; v. w7 [4 }        else inc A_i by 14 k8 {6 e& J! |9 X2 M, q6 s5 X
    end
) Z% |% Q+ o0 \" ]) @$ xend) E( o' r  y+ @8 U9 X9 B$ V

/ r( D( `2 c% L5 R; h* g+ o6 Y9 b1 Sbegin P_pick2 arriving
/ W, m) _0 A8 t, y; u    set A_i to 11
5 x* w4 k5 ]- O    move into Q_induct2
# J, x- n7 e& ~6 Q2 J    move into pickaisle.induct2
* Q* u2 f" e8 a  m" H9 B* g    while A_i<=30 do begin& }) _' m' Y$ X
        travel to pickaisle.con(A_i)0 l3 p- M/ m* z9 u3 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: F/ }' R7 G( m
        else wait for 10 sec! P8 C1 [( r3 \7 N6 Y4 B- t
        if A_i=A_leave then send to die
& l! x- [# U: X+ R0 d$ t        else inc A_i by 1) d4 `' H9 W0 p6 r' s+ s
    end
7 G0 @, P/ C3 Wend% Y" ]2 p0 n& }3 \9 ?4 C7 F

; X( t+ \! a0 O$ gbegin P_pick3 arriving
) \2 _- G3 l+ `; F/ j; e- A) b    set A_i to 21
+ n) A" `% D8 N6 }1 [: i% @( J    move into Q_induct36 g% p" w1 T- v, W' Z. v
    move into pickaisle.induct3; E3 x0 ^6 P% D
    while A_i<=30 do begin+ {3 t7 r9 W- C5 x
        travel to pickaisle.con(A_i)
/ ?$ B% o" r7 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 Z/ `& A5 l7 c, V2 h/ z5 h' _  o/ Y        else wait for 10 sec
/ _1 a! T- e* G4 b        if A_i=A_leave then send to die
. U& o9 @8 g/ K- Q        else inc A_i by 1+ C& i! y0 t& e' T  ^* c
    end
4 y" s6 X8 l) G. G0 Pend

最佳答案

查看完整内容

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是个什么东东?
6 F9 L) P3 \2 G, m! S  vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ R% m0 g5 r% e" O! @( q5 D- x& |3 W% E2 a7 b% `
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。4 l/ Q. U; \6 S2 }; I
! |3 g3 z3 L' v0 P9 o# R
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ ], h- V% m. {$ ?8 Y' M/ ~
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- i& }0 w% z% ^& U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* U. \0 x7 G& d/ A& S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" U4 n; n/ |, H* I- t* a" x& vbegin P_induction arriving
) E' U% G+ j5 g7 Z    clone 1 load to P_pick(A_induct)
( q7 n8 h3 Y. Z: x( gend最大的系8 V+ R( [; ^. Z# n( Z/ {$ ?2 Y

' g1 A% a9 \; [0 L0 j5 E: |begin P_pick arriving
; U; x$ L  B8 P% z0 e& z2 n    set A_i to procindex * 10 + 1
5 v8 r  g" S' Y    move into Q_induct(procindex), U" p$ p6 a  n- R) C
    move into pickaisle.induct(procindex)8 k3 a% ]4 f# \' ^& T
    /*check the type of pickaisle.induct(i), for your last problem.*/" `' m6 H5 T9 \% G: q! z6 \

1 T: s/ d2 \/ U; x5 b1 ~8 z5 I2 [    while A_i<=30 do begin7 l5 {* L' V  B3 Z! R: }$ N
        travel to pickaisle.con(A_i)
- H0 [$ t1 x" r+ q0 p' c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 ^- X1 X: _; K: m: s! ^4 B) Z: W
        else wait for 10 sec
: s* r, s: C3 p- P* {7 }$ p        if A_i=A_leave then send to die( {: f7 w) A" J  G4 |& Z) R/ Y
        else inc A_i by 1/ p3 V! p" b, B& b: d- g+ V
    end4 g8 {& q! C4 X* f1 E0 p' ^
end
5 w( z- ~/ X% ]' C9 ?6 k2 I( p; Z8 B+ D' B: W/ \2 f8 M- z
其中的procindex为整形,代表当前process的序号。7 t: W1 i/ O+ g" B  t
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-4-11 20:18 , Processed in 0.016236 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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