设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11125|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 {8 I& y, o9 u, O; x0 X
5 l5 e$ N  f. B" \1 q( |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. T4 F  ?) }. Z6 t& J& R' o  B& F0 R6 }1 Z9 a  \
begin P_read arriving
9 h& N- t/ r) b: C    while 1=1 do begin
  i* u( C8 i  r) c+ e        read A_tote from "data.txt" with delimiter "\n"+ ~* q+ V. E4 o* j9 `, }
        read A_time from "data.txt" with delimiter "\n"
  u2 x' t  l! ~0 ]5 J        read A_leave from "data.txt" with delimiter "\n"8 k" J5 T$ T' `8 B! G, f
        read A_picks from "data.txt" with delimiter "\n"
" W# l6 Z" d" L% f. Q! q' x% v        set load type to A_tote: R/ o; L1 k6 {/ m+ m! W( [2 W
        if A_tote="tote 1" then set A_induct to 1
1 \1 o; U) L! N, V; L( B8 p( F        else if A_tote="tote 2" then set A_induct to 2
+ E9 b5 m  L0 |5 n6 U            else set A_induct to 3    0 q6 t% W# `: a2 i0 B. K7 z
        set A_i to 0: m! ~. B1 @* B8 p! F- T5 H! U8 x
        clone 1 load to P_induction# [  G: D/ F6 t! s, e
        wait for A_time sec; v& O! B0 B* K% D8 q
    end
( Y% ]& @9 N8 W" f" ~( D. @end; P2 j; v2 h7 K/ r5 R# h, W5 i+ B

( h. P9 B, a  |' Q2 F/ Vbegin P_induction arriving# o6 ~) l' X, D4 D& k" S1 w
    if A_induct=1 then clone 1 load to P_pick1
: c5 p% u. c% {1 ?5 s    else if A_induct=2 then clone 1 load to P_pick2
  `5 X+ F3 i' T7 d3 [- C$ X        else clone 1 load to P_pick3
5 v& K8 Q4 w4 Z$ G: o* A2 c1 I* Mend; e) Q  F& I  ?% ?

2 }, [) |5 I: ?$ S5 b* W7 |. N7 Qbegin P_pick1 arriving
) x3 w) _: ]( V% K4 b* K    set A_i to 1* Z) k+ O  e9 J. J* Y# N6 c; Q' i
    move into Q_induct1: f4 W2 w6 c& S+ L
    move into pickaisle.induct1
' s6 M* f* r: S    while A_i<=30 do begin8 ]) V7 t! p* v1 ^" m
        travel to pickaisle.con(A_i)' C8 n( l2 N& t. K0 H$ V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ e. l1 f( V0 M- Q; h0 m* n        else wait for 10 sec
  A8 C2 p. T) t: o        if A_i=A_leave then send to die" R2 h7 H9 T" K3 A/ q" Q
        else inc A_i by 1
4 g0 l3 f- t, w6 m) u    end* E1 t( L8 p( t0 U
end; h+ k6 \/ D& E% C0 m" H; g4 N0 v
3 I# M9 h. V& n! [) z7 |2 S
begin P_pick2 arriving
: C& o5 j0 }$ B    set A_i to 11; z3 I$ f8 F! I! P; u
    move into Q_induct2
9 T$ _- d" u" O) X; u7 y% G) o8 N7 c% m    move into pickaisle.induct2
! S1 V' Z( h8 T8 ~0 M& f* d    while A_i<=30 do begin
3 j( i" p& Z9 I        travel to pickaisle.con(A_i)
' M: m. G+ D; L6 m* |6 }3 g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' Z- L# p, L/ h6 D6 P0 l) P. q        else wait for 10 sec' K$ l# Y  R8 ?+ R) D8 I
        if A_i=A_leave then send to die3 ?3 V3 Z; A5 B* H7 X$ f
        else inc A_i by 1
5 c4 o$ |8 b" `- {    end
8 j4 z( g$ l% ?) X0 \6 q1 x; Send- D& `$ r% U, q% ], P% j
6 f5 g; F, M2 z; W: @! E# e1 Y
begin P_pick3 arriving) }: n- n7 ^5 `
    set A_i to 21
! R: I: K& \. y  A0 T    move into Q_induct37 ~" q+ k) J, v; [5 _7 w
    move into pickaisle.induct3
  s- Y6 c/ q% N' O    while A_i<=30 do begin
8 O& ]3 l4 L$ X8 y7 t5 n4 B        travel to pickaisle.con(A_i)
) `2 N- ?  c8 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 d: V; s3 O8 y' Q! P( v$ o        else wait for 10 sec
1 E. u7 H) @, T, C9 V' ^8 |+ ^        if A_i=A_leave then send to die
4 \8 L- c* |$ ?        else inc A_i by 1, E) ~7 p& o; T, L* v
    end
& R! g! t. \6 |$ @2 ~' V6 R, Jend

最佳答案

查看完整内容

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 @. F& S: E5 `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- U& A3 I- a* e9 O
! }% Z; Q, o7 n- c8 }* n
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# U4 p/ V' ~/ i5 D
9 z1 z$ y) Q  B) r另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 D  R/ T; w" u6 W, T; Y# K
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ ~$ M/ n& y% m4 \2 [
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 V' q2 D' J6 \7 n6 f9 p
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: N- h! t; W2 Z; m' p
begin P_induction arriving
, ]9 j# k! c' [    clone 1 load to P_pick(A_induct)' o$ [0 Z9 Y8 c6 x5 c& |
end最大的系% n) I4 O0 m+ ]. `

: z% U8 ?4 G+ Z' t; g- @9 c; Sbegin P_pick arriving
( q1 b2 P% l7 f( ?. C    set A_i to procindex * 10 + 1& o: I& Y' F% L* g' D% P, K
    move into Q_induct(procindex). W2 {; p' ]$ m' y, ~0 r
    move into pickaisle.induct(procindex)! e% n5 F/ C& j' O: ?. t9 R3 Z
    /*check the type of pickaisle.induct(i), for your last problem.*/
5 s) u& Z# M, M1 k  i5 ]0 j  U8 M4 Q3 L; `0 J3 B( X5 b: b
    while A_i<=30 do begin
7 Y  y+ _4 H0 V+ D2 ?  D- k/ l/ y        travel to pickaisle.con(A_i)) X% ^1 N3 ]$ P8 z, o1 g, m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S( m" b) D' W
        else wait for 10 sec! Q6 c: W) k' q0 u# m2 n$ p7 W
        if A_i=A_leave then send to die- g7 {' }' O& u5 p
        else inc A_i by 1( K6 f$ ?/ u4 |$ p5 W2 M4 A
    end
8 W$ }9 @7 X; L  h2 _: oend
6 b9 Y4 w0 {* _# u5 \
' \1 ]' W" q5 M5 M- Y其中的procindex为整形,代表当前process的序号。% h% _% o- N& y& 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, 2025-10-25 12:42 , Processed in 0.016041 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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