设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15122|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 u3 M$ G$ K# |5 d" t4 `" E8 C; `# |; @# t' Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  `! r; A; K( ~( a# m6 F
. A  H3 M% }' D- k( r0 Q( k9 gbegin P_read arriving
+ s6 p7 ~+ Q0 p& O# r8 m6 |    while 1=1 do begin: }" k9 H- B, T$ w! q+ E) S
        read A_tote from "data.txt" with delimiter "\n"8 F9 _8 \4 B5 v& Q
        read A_time from "data.txt" with delimiter "\n"
7 A+ Z" {. V9 A" ~        read A_leave from "data.txt" with delimiter "\n"
! Y3 E7 t8 m. _8 K        read A_picks from "data.txt" with delimiter "\n"8 Z# \" ~" x* A4 w
        set load type to A_tote7 G; G) P' }) ]- v, S
        if A_tote="tote 1" then set A_induct to 1
5 K/ x  v. s0 V' f7 k. c        else if A_tote="tote 2" then set A_induct to 2
! y0 r( }; M6 S/ d+ k5 i            else set A_induct to 3    . I: l1 ]% |- p" X6 A% `
        set A_i to 0& W  a. ]/ C0 j6 x. G* V, B
        clone 1 load to P_induction- q! I2 v% y% a1 p# J
        wait for A_time sec
9 [, r0 O' i+ e: L4 z7 b/ u    end
* p% f# V8 K( K* yend2 F. f5 ?) ^+ h0 y8 P# r+ F' |
! _( B2 o; f7 [# \6 g. v* b
begin P_induction arriving) S6 U  @& g! A+ e5 ^+ r
    if A_induct=1 then clone 1 load to P_pick1
2 j/ E% x9 S9 k+ g$ j" r: u    else if A_induct=2 then clone 1 load to P_pick28 Q+ d2 n# Y0 V8 d, a" a* Z
        else clone 1 load to P_pick3
7 i, U. r# F$ m% q. ^$ uend0 W3 V" e, ~  S# ?1 w+ v( J

- K; S0 }' C2 g7 B( g- v( O" V9 gbegin P_pick1 arriving
6 Q  p; U" X8 H, W9 m4 t! |    set A_i to 1# {4 a5 b" `- E7 h
    move into Q_induct1
  P' m; d% r$ E4 P9 ?    move into pickaisle.induct1
4 R" H" ]1 t0 o' h& F+ S# k    while A_i<=30 do begin4 p$ ^& \' t' y) }7 ?
        travel to pickaisle.con(A_i)- p/ J9 o  V- D/ K3 `# L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: D2 {1 \- j9 X" B2 U1 W; G9 G2 C
        else wait for 10 sec
  C+ c% R2 n1 F1 R8 F        if A_i=A_leave then send to die
) k+ W2 U7 }+ {3 t        else inc A_i by 1
0 u$ ?# `) n2 v  S4 N    end
, ^! Y: r( u/ ~+ T- ~, `  S8 qend/ F1 d6 k8 p$ U$ s( I& |3 U- G

; T- F0 K( l, n8 j& c, [( Ibegin P_pick2 arriving
/ P4 C4 A# ^* K6 H    set A_i to 11, [1 ?/ N6 j3 K# \0 D* s: ~& y# T; L
    move into Q_induct2
# o9 y( n$ P! v5 V( n# X    move into pickaisle.induct2
9 Y& s, k: ]- t% O  T0 B8 V# w" n    while A_i<=30 do begin" z: P8 S2 F; g5 V: t& j' V# }- Y
        travel to pickaisle.con(A_i)$ L- J9 S2 \. ]3 B& v0 y8 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& S' P6 x* C" Q3 M! x4 e3 V        else wait for 10 sec
2 j! @9 O/ ]/ x1 ]        if A_i=A_leave then send to die
6 g" u* l, u- L3 y( I/ \/ ?        else inc A_i by 1
5 L+ H9 v1 h2 f' V    end
' F0 Z) Z3 Z2 m* _$ O: Gend
! Y6 C' |# I2 j
) D; V+ ~% b+ Pbegin P_pick3 arriving
% q( N7 x, W9 I( X9 [    set A_i to 216 Z; h; v  h$ W/ b$ x
    move into Q_induct36 M" n0 `  e  L; b- U) F
    move into pickaisle.induct3
- Q( Q; ]: y* X& O8 C( @    while A_i<=30 do begin: `6 ^9 w$ O2 p( H) l8 M# X
        travel to pickaisle.con(A_i)- R/ b# G; f" {3 u& o6 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ \7 i$ m1 f: M+ U5 z, g        else wait for 10 sec! E1 ^& j0 [- S2 }4 ?
        if A_i=A_leave then send to die
/ Q+ h) C5 m+ U        else inc A_i by 1
; N* N5 a  n. `! C) Z7 z, v  @* y" ]    end* _7 V( a: k1 y. I. X& p
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* x3 Z) D4 |4 l/ @move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 U$ \& K- F( O8 X
* h3 ~2 S1 a2 c* M  o0 @0 k7 {AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 e# \3 X5 x, i' T+ O) u8 ^; y0 p- p9 ?) m* M8 {8 w, N
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. M6 G  H. ^# y! B' j. a1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) {. h4 }* a. X! f- C* r2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ u" n" P! Q+ c% i! g/ ?/ R) z$ n3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 n: g" R3 l* Y6 G' V# x6 `
begin P_induction arriving
0 @+ r: d6 M9 @, N6 j; I7 R    clone 1 load to P_pick(A_induct)" {; c3 k+ ?7 ?1 S" K, g
end最大的系& w0 F- e9 Z8 l, ?

( E7 _/ |% p! A* k+ f/ v! D% a5 R3 Sbegin P_pick arriving0 U- v- g7 r2 m2 W3 y
    set A_i to procindex * 10 + 1. {6 l0 D5 I# W
    move into Q_induct(procindex)6 @2 K- @/ Y+ m. F
    move into pickaisle.induct(procindex)
( ^* s5 B" Z) H. A& R6 g4 Q1 _    /*check the type of pickaisle.induct(i), for your last problem.*/
# {( L! C; U' X% u! s# g' v
, t) v" I# m: P+ z6 X    while A_i<=30 do begin) t' ^# `" H2 p: W
        travel to pickaisle.con(A_i)+ F# B( A7 L5 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 w1 @- {, s9 ?2 R; i$ a
        else wait for 10 sec5 N9 c6 S  Y' X/ Y" u' m& w
        if A_i=A_leave then send to die
9 P* U* U0 ?) {) P5 o1 r: h( Y: [        else inc A_i by 1
" E4 @- D8 ^, ^6 s    end
0 Q% ~, V/ A/ t7 Yend3 b' ~3 f0 o; F* b7 u

$ z- ]) _5 o4 R" O5 h; R1 Y1 w其中的procindex为整形,代表当前process的序号。$ n$ b( X( H) J! U7 _+ e# b7 R
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-12 12:33 , Processed in 0.018161 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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