设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15175|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 n; [& ~, D& I5 x
3 s8 u/ o: O0 R: ?* h3 F
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ k( `- q! j, b! ^+ k
7 k2 U3 x; P1 k( n4 Obegin P_read arriving
& ^; }  ~& R, @7 p    while 1=1 do begin
- ?% Y. i4 ^' f* l- D        read A_tote from "data.txt" with delimiter "\n"
# P- S9 a' v% o9 t0 u9 ~        read A_time from "data.txt" with delimiter "\n"
& `; q0 r# B* S9 F) P1 G. p        read A_leave from "data.txt" with delimiter "\n"" Y% R/ b0 T9 {) r
        read A_picks from "data.txt" with delimiter "\n"
, [, K( D1 O8 W( S. f        set load type to A_tote# ]$ V$ Z( `% T+ L$ S
        if A_tote="tote 1" then set A_induct to 1
: y* F# j3 w+ R1 H. T) o2 `2 A7 L; o        else if A_tote="tote 2" then set A_induct to 2
$ B! M3 L& b& G            else set A_induct to 3   
" w0 L9 R5 `6 j6 U8 L0 ?        set A_i to 0
$ y& K% A7 w$ B* i* s0 [) _8 l, N        clone 1 load to P_induction1 k( j9 D$ B5 u- v
        wait for A_time sec4 p" _" x9 T) q
    end3 q- S' H2 q" ]+ i
end3 L* t( f9 G7 I5 s8 s1 z
" o6 Y, H: y* r4 L( P( s
begin P_induction arriving
0 Z* G3 Q4 F3 P9 k) M% K    if A_induct=1 then clone 1 load to P_pick1
& S; S% u' h! _/ _5 `    else if A_induct=2 then clone 1 load to P_pick2! ^$ S" A0 f4 a- d/ g$ ?4 r: Y  [
        else clone 1 load to P_pick3' Q* s+ n1 G  P+ E* Y1 V- a
end
. F* {0 ~8 Z8 I! p4 f+ w* i  R" z9 n& r' r: u
begin P_pick1 arriving
# z' x8 s3 a. x    set A_i to 1  G- V( w% d# p; x1 E
    move into Q_induct14 h1 b5 S; w/ K% v, K1 ~4 }% m
    move into pickaisle.induct1+ z" H7 I, y% S2 h" _. \
    while A_i<=30 do begin
( o! d' d( @. O; y        travel to pickaisle.con(A_i)* J: S4 ^% @7 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' J! W0 T0 R9 q8 U* ]: j: i+ {9 m        else wait for 10 sec
" ]9 m3 \2 }8 F" c" E        if A_i=A_leave then send to die
* n4 j8 F) [9 o& g" x: }4 q        else inc A_i by 1* Z. e* S( W/ I+ v
    end
, \5 @+ A. D4 K$ K& jend
  Q' t  x2 s8 `) t/ B$ W+ D" a; _5 t' U1 L5 ?2 k; k
begin P_pick2 arriving
7 {" K9 C1 Y0 h  z9 Q% d    set A_i to 115 B: Z* z6 \5 d! b; h0 [
    move into Q_induct2$ n7 D, f3 P" m6 ^* a& z
    move into pickaisle.induct25 z. F5 d) w( Q" H( M3 J' w; H/ W1 s! l
    while A_i<=30 do begin
( |" l/ b0 o" {+ o5 B2 s        travel to pickaisle.con(A_i)6 Q. d7 ^2 f( f" {1 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ V, ]8 [/ R/ B4 M        else wait for 10 sec# @7 d( ]' B6 m; ^+ T
        if A_i=A_leave then send to die
$ f: |, l  V# i1 O# v# Q        else inc A_i by 1
1 Y& U- ]4 X- B  T4 l# }6 V& P    end
" X1 o. h. Y* B2 C6 jend$ w) ], o0 w; h$ a/ o$ k
! Q1 b  I0 b  C0 i' g
begin P_pick3 arriving
% Y. I: m8 T9 ~5 m$ L    set A_i to 21! ~9 u( a% p5 C
    move into Q_induct38 y0 n& n5 Z" F4 U7 d
    move into pickaisle.induct38 R; `1 \* s8 |$ I
    while A_i<=30 do begin
: n. {) |2 T8 q        travel to pickaisle.con(A_i)
) V5 d" q% ]  ^/ C4 J0 O0 J; p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; K: h9 `- {1 D8 h
        else wait for 10 sec
1 W. \, f( ]/ J( D, f* ]        if A_i=A_leave then send to die8 J% }6 D3 m6 s
        else inc A_i by 1
" C/ @( K& ?0 @- ^* S: A* K    end7 d8 i4 l& F8 v
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是个什么东东?: v. w" Y& }$ w4 o' |2 s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ z2 B) D7 T1 j# r1 r" }6 b1 U  s2 J! d" j7 U& j; D* H1 N) ~  k+ O
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' @+ Y. \; q/ U6 Y! b! J
& R: F! P4 p0 b- l4 d
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, q6 l' m8 ?' z4 O7 P; n
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* l: g- ?5 y2 I/ |( I6 }; e
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% }! _- v0 g: ~+ q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 p  h2 r  x4 Q9 i! i
begin P_induction arriving$ G9 `- K) I% z$ x
    clone 1 load to P_pick(A_induct)9 C- t- J( h: s8 j) v
end最大的系1 _0 C  ^* u, O

" i: D$ ?$ B- K5 v3 obegin P_pick arriving
6 m  ~1 D) c6 O3 s4 a- e2 i5 o    set A_i to procindex * 10 + 1
4 L6 x# L6 g( C# O3 m( f- c+ n    move into Q_induct(procindex)5 c" e. `+ g$ h. f  @5 x4 P
    move into pickaisle.induct(procindex)6 W; p* a% d8 L) D: i0 _! B
    /*check the type of pickaisle.induct(i), for your last problem.*/
, p: Y) j, {! n; |& f
1 J$ |( C$ A/ i3 B& G- ?    while A_i<=30 do begin
1 o1 Q. x. c3 b: s# R6 w" B+ H/ Z( c        travel to pickaisle.con(A_i)# A7 ~8 C  u- ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 W) e, X  o; J6 V- o        else wait for 10 sec3 ?9 C4 [8 D5 ?/ P
        if A_i=A_leave then send to die2 }% g5 F, b9 Q" _0 q
        else inc A_i by 1- o% j/ b! e6 O3 e$ _
    end
- w: g. Y6 y. q0 A! y4 B4 Yend, x0 y5 p0 L, S, A7 o
3 _4 ]- O) E1 D8 N5 K9 N
其中的procindex为整形,代表当前process的序号。+ q1 V1 n# d! J
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-8-19 22:00 , Processed in 0.017914 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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