设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14155|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ w" o. y! r8 s# T7 @! q. o4 f

) s8 T2 [) {1 b+ y' W0 F& `0 I% M2 d我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' Z: d0 r7 ?  G3 j4 e. l+ ]& m8 [  f- N! A7 S) b  N4 q
begin P_read arriving
5 t/ e' t5 `! `+ ^2 @) x6 j( q    while 1=1 do begin
6 I7 n! h# M/ w; ]- ]        read A_tote from "data.txt" with delimiter "\n"! B2 C5 {+ n+ g& a* ?  a
        read A_time from "data.txt" with delimiter "\n"& @: x% s) a) e
        read A_leave from "data.txt" with delimiter "\n"
' x3 {3 Z2 O3 W% U# V        read A_picks from "data.txt" with delimiter "\n") w3 s( D" v; @* X( h4 W
        set load type to A_tote: K0 E$ c9 E$ M( v5 o+ k( X# [
        if A_tote="tote 1" then set A_induct to 1/ D" p5 [6 @$ |$ G4 x
        else if A_tote="tote 2" then set A_induct to 2
- h3 [( ^7 e/ A3 ]            else set A_induct to 3    " g; k4 b& ?& X+ y
        set A_i to 0
) |+ D* Z# @# Q: K- Z, C        clone 1 load to P_induction  g: i# q: s) z; I
        wait for A_time sec: ?3 @' z2 r& k% k
    end
/ E5 z: c8 ?3 [3 iend
3 ^6 A3 [8 z: w8 _/ c
. z/ P! v* _) u; z( rbegin P_induction arriving
  p$ W5 j0 Q4 r" ^    if A_induct=1 then clone 1 load to P_pick1
9 n# R6 K8 r9 r; f) `- ^' G    else if A_induct=2 then clone 1 load to P_pick2
2 G: z7 ]% x3 j$ f8 O' c, x        else clone 1 load to P_pick3
  r" v4 V: H  N' v4 jend
6 E& P- Y7 w- O2 J' A1 c
! R9 u! v! B) @6 r/ S5 n! a# bbegin P_pick1 arriving& Q0 ^1 i3 S" p7 g
    set A_i to 1
3 q* u7 Q3 O. x0 ~5 c8 m2 R    move into Q_induct1/ h% I) [7 v+ p# o! p' U! V
    move into pickaisle.induct1
: e0 l6 e0 _5 l$ t    while A_i<=30 do begin
' i' P: R7 r4 C$ b        travel to pickaisle.con(A_i)
7 v* G% w& S( E3 Z+ R1 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 m/ e( x( j) d* r, X& H        else wait for 10 sec6 Y: D: s3 U; O8 B. C
        if A_i=A_leave then send to die1 K8 J) ~& N& {4 g" |
        else inc A_i by 14 q7 b" g+ w; _0 I- @
    end
$ v. K# N9 a& H, aend) P& r- b( g# q( Z8 |- l. _
' T; E- t2 ~) W) L6 g4 C, |
begin P_pick2 arriving
0 S; ~% C& @0 n    set A_i to 11
/ ^1 b; k3 X9 f8 C- F0 x6 W' N    move into Q_induct2) g# r8 ~! }5 g$ G0 Z0 Y0 ^
    move into pickaisle.induct25 ]& T' z9 ~' J( X& F
    while A_i<=30 do begin
8 R( f% K. U5 y. s4 r7 `        travel to pickaisle.con(A_i): C$ B, {- a# }6 p8 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 f: w5 q3 p# U# e* ^
        else wait for 10 sec
( ]1 R3 O5 I# M* U. _  k- m        if A_i=A_leave then send to die: b0 L! x5 e, t0 [& J( ~
        else inc A_i by 1
9 N1 s8 m" o: {0 J+ C    end
- j3 Y& A9 \: C$ P' w' qend
1 W' J" Q/ b: L2 ^
/ r  B$ H2 }8 N9 z7 hbegin P_pick3 arriving& c4 p8 K- x; o
    set A_i to 21
. O6 G: q9 y7 s5 q0 c, H( n    move into Q_induct3
4 y" v3 U* Y: w% h4 \# R$ O    move into pickaisle.induct33 b/ y2 O2 q' v0 |& y9 s6 \
    while A_i<=30 do begin4 t" A2 q+ \6 m6 J6 h# V
        travel to pickaisle.con(A_i)
3 B! F+ ~4 l0 s% [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& z: k4 o, h( b
        else wait for 10 sec
6 ^8 f; P6 C; [' F& I5 T$ a        if A_i=A_leave then send to die
6 j1 J0 N  R4 V7 T  R7 P        else inc A_i by 1
" g" [1 |' L1 b7 h    end6 k0 J! a9 g  y2 b- C* Z5 x" u( M
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是个什么东东?
/ m; i# g/ w1 N& L- t$ Q. ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' v: S3 ]* p3 k) t3 A

/ \1 d9 B8 N+ O. F1 pAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ R$ O: c2 }6 ?0 j& a
6 r" f/ U6 H+ A- m9 h
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 n/ T0 q; u) R: h4 j( I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# |5 @$ L7 f' C2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- }9 ?8 ?; V' q, K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% @% m- Y$ ?: c/ T* H' {6 Y( Cbegin P_induction arriving% ~( \- W& P! R
    clone 1 load to P_pick(A_induct)$ U5 O; V  f5 e  |$ g$ g, K
end最大的系3 l/ p8 U& w% }& v0 s& @4 y
# V* G9 t2 K8 ]! i- H4 h3 T% v
begin P_pick arriving+ L3 W- F0 F1 X. e! i
    set A_i to procindex * 10 + 1- v! _$ e4 M5 `6 y2 g# g6 u* F0 i
    move into Q_induct(procindex)
6 C3 _/ R: u, h' f' E2 [    move into pickaisle.induct(procindex)8 ]& J# W5 b" z- F
    /*check the type of pickaisle.induct(i), for your last problem.*/- J- J3 w7 J: o( q& O1 f( n: G
3 T; `6 \/ l) i+ [$ |# V8 d3 ^
    while A_i<=30 do begin
4 C; `0 N3 @& b$ j9 L& l& }8 ^        travel to pickaisle.con(A_i)
/ u9 t: B% }& ]- K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 i3 A( f$ b0 e: h# T3 Y2 N
        else wait for 10 sec
, N( |2 j) Q4 h, \/ U        if A_i=A_leave then send to die& S& K6 F' `  e5 _' M
        else inc A_i by 1+ g" b* z' j+ D6 s; ?$ L( [
    end5 R6 E- B/ _0 v" @& D' S* @
end
- c2 z+ j) A) ^
, {7 k/ Y8 b5 p, ^& j其中的procindex为整形,代表当前process的序号。
4 O+ i& H6 ~( O* @, B; astation和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-6-15 00:41 , Processed in 0.019594 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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