设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14725|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# g+ w2 Y, a* j8 C& W  y

  D6 h: D7 c, l& N, i我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ ^! o9 I( E5 ?$ \# m, q

: G  [  }+ T0 ~' P# f8 m) |begin P_read arriving) d. i0 C2 f! C* h: l7 [/ n5 y
    while 1=1 do begin, x: `$ I6 V* `+ w
        read A_tote from "data.txt" with delimiter "\n"$ |. o, \6 A0 A  j
        read A_time from "data.txt" with delimiter "\n"& X, N8 _% d( W7 @
        read A_leave from "data.txt" with delimiter "\n"
; `! n: C$ T6 f2 k% Z! f3 P! n* Q        read A_picks from "data.txt" with delimiter "\n", D/ {' _. i. ]& G+ ]& G
        set load type to A_tote# ]: Q( k  q: [6 p2 [, m* U7 ?; x
        if A_tote="tote 1" then set A_induct to 1+ Q, o2 D" g' g  k- {3 s
        else if A_tote="tote 2" then set A_induct to 2
% b) k0 M6 l# ~$ P  I+ k            else set A_induct to 3    9 i5 |/ ^7 ]$ p3 @+ f
        set A_i to 0& G) s1 w) K& g$ k7 v$ }5 P
        clone 1 load to P_induction* s. }$ ~; |5 _: \9 w6 H
        wait for A_time sec
$ ?9 J- X- n% _( {    end
; \. D: {# r& |2 \4 j0 ^end/ `4 i: v* k2 k; [
  c- i8 c0 U: t3 [. S$ `. r: t
begin P_induction arriving
2 s/ j0 E9 T/ z6 p+ `1 ~2 L    if A_induct=1 then clone 1 load to P_pick1
' I% B4 v& w; J' e# ~    else if A_induct=2 then clone 1 load to P_pick2
+ A6 M1 E0 A- P9 Z, d# W        else clone 1 load to P_pick3- [: P1 B, s- m8 E
end5 E4 W- ?: a1 K3 q! Z2 g

' {/ P. e/ {1 a6 `) o; L. gbegin P_pick1 arriving  A+ u- n9 }( C7 u2 W  q' x, s. d
    set A_i to 1
4 S. {; w! ]1 |" M    move into Q_induct1" p8 d: `8 O7 _+ M- z, [) l& |& I
    move into pickaisle.induct1
1 Z* h# o& l4 i    while A_i<=30 do begin
4 R5 u$ P; H2 a        travel to pickaisle.con(A_i)/ H2 Y  O# l, {! j5 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& `7 |, P9 J/ h
        else wait for 10 sec
9 c3 M1 p' u& z, c& m        if A_i=A_leave then send to die
, F" }- p2 X! y6 M0 m6 R, L        else inc A_i by 1
4 |2 x6 S* Y; s7 ]& G    end
( {" Z+ p' j7 B% c5 [9 Z( Wend
5 m7 Y, m# I: A4 Y$ H% f) F  x2 C5 w8 Y$ }" o1 J! ?: _0 c
begin P_pick2 arriving
+ ^; c0 T/ q! ~, F8 N    set A_i to 11! J( A) Q2 x, U' a: x
    move into Q_induct29 _2 ~2 `1 `6 h' `7 b3 L1 u$ j1 Q
    move into pickaisle.induct2
2 l$ t: Y* W& Y' \8 n& \3 K    while A_i<=30 do begin
# I; O4 L$ c* p0 [/ V. E/ T! t        travel to pickaisle.con(A_i)
, ?$ }: y0 r2 _! {$ M3 F6 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* y* f4 O5 R- _2 a! _/ H2 {. u
        else wait for 10 sec2 z( N/ Q9 w7 D& j
        if A_i=A_leave then send to die
4 ?* V* {5 X' n        else inc A_i by 1/ q/ W4 i0 C) G3 M5 j
    end
2 c) v$ {, h- t7 f) K. n8 }8 w! Nend$ e& Z# s7 Q6 N2 R3 Q9 t- ~
% h" f$ u" v5 o( V8 \
begin P_pick3 arriving( l! [* ?# I4 l  r! j+ f9 O
    set A_i to 21
# s' \2 {6 b* E+ O2 R% l; q1 |    move into Q_induct3
3 J* D4 D7 i; `" b' E    move into pickaisle.induct3& L9 W) w/ j% r5 r; ]+ u
    while A_i<=30 do begin, k! S, N7 `6 w& y7 z% E) b
        travel to pickaisle.con(A_i)
0 {" P* T; @, O& a" m) ]- h0 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; K# V% H$ `; w$ P
        else wait for 10 sec* `9 j) ~/ w0 L9 T* n6 M' @; B4 u
        if A_i=A_leave then send to die
+ J, B6 s" K" u' t' z! @2 S4 S7 x1 w. I        else inc A_i by 1
2 u$ d% w# R, r2 B5 W+ W' _# |    end
2 k9 _) H7 o+ h5 k  J$ m7 Tend

最佳答案

查看完整内容

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是个什么东东?+ g- O% N" ]2 b$ H$ t8 _* S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 S& D4 Y- S4 z8 _$ O. s, f0 \. b0 }1 {
" w% L0 V' y4 g: d  ?0 V. x0 M- tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- s0 u! y) u1 C/ m+ q: n' [8 h
  i% R+ E2 I2 s1 G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 y7 C( q# F* T: p! V1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& [* x; s7 k5 {! ^2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& E% ]# d1 V& V* g: E6 {3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: N- K5 w5 \  W$ _7 ~- c
begin P_induction arriving
7 u6 Y$ u& b+ P$ f5 }" i    clone 1 load to P_pick(A_induct)
5 }" s; {# a+ Xend最大的系) Q! D7 z( L* a5 |9 m4 g
$ `" v3 c$ P) C2 E$ D
begin P_pick arriving
; P$ h2 j" |# z- G8 G4 Z    set A_i to procindex * 10 + 1- e( L( d+ S* ?. L) Y. r: u: S
    move into Q_induct(procindex)
2 s; G9 c* F/ t, C    move into pickaisle.induct(procindex)/ M4 K8 U, C0 Z0 I1 M& w  W+ g
    /*check the type of pickaisle.induct(i), for your last problem.*/
/ v7 a1 k( J. x% b' e
" C3 z* [0 k3 S3 s8 [) \    while A_i<=30 do begin
% D$ V- i& d) G. ^  C        travel to pickaisle.con(A_i)
8 U, e: j; @1 p- ?* S# u) d; P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 P: h5 l3 g# s  N7 N        else wait for 10 sec1 R. Y8 s3 E" }( k- o0 x4 l
        if A_i=A_leave then send to die1 i; p. f/ w3 w# v, B7 |* T
        else inc A_i by 1
, z, M% T/ `6 U    end! t+ C1 v( N% m0 X9 E! b% w
end; M+ |5 \& D& j0 ]

0 _. p- P' H) z8 @其中的procindex为整形,代表当前process的序号。& C- ?5 p1 L. A- F3 k5 R- B
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-7-23 05:07 , Processed in 0.016606 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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