设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12461|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( j+ f  I2 h9 ^/ p3 \
) R/ m" k6 T0 c1 \1 ^
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  I( Y% g. Z* u- q0 k8 U7 P

# G9 |' B) h8 y4 M/ B; m/ R3 Rbegin P_read arriving) t- J- @$ `- b. s9 i8 G
    while 1=1 do begin
# n! H3 k4 @4 T" U3 e* a; p* r        read A_tote from "data.txt" with delimiter "\n"
/ F5 R7 u5 _9 ~( d5 @        read A_time from "data.txt" with delimiter "\n"
. ^3 g* b$ e: c0 L# |, ]1 t        read A_leave from "data.txt" with delimiter "\n"4 T* q7 R- Z. y
        read A_picks from "data.txt" with delimiter "\n"
; ~  ^7 |& X, x) [" h$ B0 Q- j        set load type to A_tote
+ B7 N) a' V4 D6 m5 ~  r8 c        if A_tote="tote 1" then set A_induct to 1/ l/ `: _/ v; k4 i" S
        else if A_tote="tote 2" then set A_induct to 2
' O" ^; S- j/ ]2 O2 ]            else set A_induct to 3    7 y4 A( K. A% z  _% V/ [  y
        set A_i to 0
3 s! C, @- x" ~2 r2 `        clone 1 load to P_induction
/ b- H. w4 ~3 G        wait for A_time sec, s% F+ f7 G- }) |. F: b0 d+ b
    end
7 B# ^3 D0 E9 P  @end: z: h% k9 ^! w7 Y/ C2 K

, z) @5 F- `# K3 ~; k/ vbegin P_induction arriving: e  t' C' ~% n0 u) g1 J* Z
    if A_induct=1 then clone 1 load to P_pick1
3 Q! H0 D' `# r: ]    else if A_induct=2 then clone 1 load to P_pick2- R, g0 U: O  Y, W+ b2 ^
        else clone 1 load to P_pick3; C4 p3 T4 ^# [0 [) Y  h
end
5 L2 m: K3 X8 g7 j/ G8 K
9 ?( B# p2 F# X) y3 ]begin P_pick1 arriving
. A" C5 A, Y4 }) p" `; H/ }. n    set A_i to 17 F2 q8 z$ f% C
    move into Q_induct1
! c& `5 A! U% Q: [' y7 b    move into pickaisle.induct1; k& r( H" |6 C% W8 [' J
    while A_i<=30 do begin$ b) t9 J/ y3 E+ |2 V
        travel to pickaisle.con(A_i): y; C% u3 j# r& b* K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 V5 I& ?& {. A" z
        else wait for 10 sec
  x; s% q' ?1 q( ]        if A_i=A_leave then send to die2 Z8 ]. m7 p3 m; k& d- D6 n
        else inc A_i by 1
. O( f5 c' n' n% Y0 s9 A" W2 T8 h    end8 b% O* b8 y) [+ ]  F! f# Y
end7 k0 F& v1 z8 M4 X5 A

8 e& Z& k# @6 \$ P; C7 p" `4 H9 Obegin P_pick2 arriving
, N3 ]0 O/ Q. B& r1 z* F& B+ r) }) ?    set A_i to 114 H) n( ^7 E/ h. a" t6 ^+ w
    move into Q_induct2
% E, r6 l% z9 b3 J    move into pickaisle.induct2
# q2 _. {8 t* ^* [' j4 f& g    while A_i<=30 do begin
2 v2 ]/ G5 [$ J+ L        travel to pickaisle.con(A_i)
5 v5 c% q4 M) ^# K7 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 z% U, F0 g, _2 V0 @        else wait for 10 sec9 o9 o. N  ^+ Q; q7 C3 ^" H
        if A_i=A_leave then send to die
# n7 c7 J! m8 D) S# R& W        else inc A_i by 1
4 B. }4 x1 ?2 e. k1 J    end
6 Y' c5 e. O0 C- M5 h/ }2 g8 o- Kend
+ Z& ~( }! R: z6 u  z
2 J2 H7 g5 n7 |' T' b( p" r, C3 Ubegin P_pick3 arriving' d2 [# o& |+ r$ v) F
    set A_i to 21" b) u) x, g! t
    move into Q_induct32 c2 B! G  e4 T* z* l) y/ V! z
    move into pickaisle.induct33 O# C3 V. {* x+ r& s
    while A_i<=30 do begin
. C: R' u9 K4 u0 a3 f+ ?# `7 W        travel to pickaisle.con(A_i)
, ?4 j2 G9 Y6 P+ b6 E/ c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 M6 h+ l, x6 Q, R7 d  b
        else wait for 10 sec: W! i' O8 _+ J. v5 i; |' t
        if A_i=A_leave then send to die
* c3 J- a8 I7 s; I- a        else inc A_i by 1
% ^% z0 @) i; _- G3 e6 O% V    end  B$ s# N/ @/ ^& w, U4 c9 Q
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是个什么东东?2 I) ~2 E  q) a! t: l+ x- A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 A0 Y0 K' D& |5 g
/ N  Q" u* c4 y. i% e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: M# F* m  p, _& n1 w- r
3 V% ?3 N; |& b" Z' K5 ^: p7 \% W
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: d$ A0 T9 }  w" l0 @1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% ]! e$ G( A6 i/ n0 X+ K( d5 i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% ?0 X' b4 q& C8 P+ n
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! k9 ?9 m2 I3 c' y% o, n* P
begin P_induction arriving
: b% @1 a  z4 l    clone 1 load to P_pick(A_induct)* ]  r" F/ R' P6 g
end最大的系
1 k7 p& Q( h  M5 Q2 {+ m+ s& d4 d# d! t$ t0 j. H1 j
begin P_pick arriving
8 o9 h* Y0 P5 I    set A_i to procindex * 10 + 1! x$ [/ e2 g$ W! T. f  M
    move into Q_induct(procindex)
9 [1 G$ D& s" X' X' M    move into pickaisle.induct(procindex)+ A, d# n. F+ L1 u; X/ W' K: j& W
    /*check the type of pickaisle.induct(i), for your last problem.*/% y& ^6 O3 |1 b

+ ^+ i( b8 w1 ?" F  ]& T0 v    while A_i<=30 do begin0 ]$ L& r2 X( n' v
        travel to pickaisle.con(A_i); G. K6 [) U/ h7 _0 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 Q+ }. {8 U8 C/ F- y  ]        else wait for 10 sec: _# N" M5 N( S3 Q, }  t( _8 ]
        if A_i=A_leave then send to die
; V  I& B0 Q8 P5 l. ^        else inc A_i by 1
- p9 l: @7 k, k! X; ?4 Y% a# d    end6 W; z+ Z# B" X6 v
end
$ m& i# q; U* [, G+ Y1 O9 _- H8 M. I
其中的procindex为整形,代表当前process的序号。( @4 J8 ~  @# Z( h+ c
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-1-26 02:19 , Processed in 0.017647 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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