设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14346|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 D; d: a/ z3 a4 a
; E% ?5 o0 E/ m" j% j* `4 W8 M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 F) t+ j8 H; m3 `& i6 a1 e/ _
1 P' m  u: b0 \
begin P_read arriving9 |/ Q0 e  z, ]6 Q4 i
    while 1=1 do begin$ ]) j. i# Q! b# N
        read A_tote from "data.txt" with delimiter "\n"
$ X* d" Y) }4 v        read A_time from "data.txt" with delimiter "\n") s) t' O7 \8 M/ _8 f
        read A_leave from "data.txt" with delimiter "\n"
% h0 v7 z! X& h        read A_picks from "data.txt" with delimiter "\n"1 R& y/ L9 B- `. P" J3 U7 K) d" r
        set load type to A_tote
# V' {8 f5 B3 w0 ?0 V0 ]        if A_tote="tote 1" then set A_induct to 13 p! V) ]; Q( v! l
        else if A_tote="tote 2" then set A_induct to 2
( p3 x* \+ i4 W# T- [$ q8 K            else set A_induct to 3    $ a6 H: u: Z$ q" r$ h5 \! ]$ T
        set A_i to 0
5 r" q$ {: ~8 M2 Q1 f2 ~        clone 1 load to P_induction
# a5 ?2 X. M7 y$ x+ ^        wait for A_time sec( y% C) d& r& S
    end! e: N1 S) y3 l; T! i  k( J
end
. t1 T; k- `4 |8 }* [- Z: u# W) k# A/ K) a* \0 y
begin P_induction arriving) o4 |6 I4 `( @* s. ^
    if A_induct=1 then clone 1 load to P_pick1
# e3 u2 I5 c1 Q# C- d% D% E/ Y/ m    else if A_induct=2 then clone 1 load to P_pick2
  @* D9 y) Y8 _( P8 `3 e        else clone 1 load to P_pick3; S* B- s* Z4 b9 I; F( i6 x
end- p6 g8 f# R2 O4 u" }6 w) }* _/ ~

% v8 d) q! k4 L7 [3 j6 mbegin P_pick1 arriving/ X! I- j! B$ K5 W( x# P( I
    set A_i to 1
% I9 W- H, P+ T    move into Q_induct1$ m# @2 @" H  T; x6 g
    move into pickaisle.induct1, |  A9 Y7 \8 ~9 B/ l) d/ O
    while A_i<=30 do begin
% i) a! L8 M% l* \: o/ n+ v0 s        travel to pickaisle.con(A_i)3 f( h2 ~) T$ V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( U. `2 z0 ]0 L. N! M
        else wait for 10 sec5 I9 `# r! f6 h$ H5 s: m# X: ^! B
        if A_i=A_leave then send to die
. r8 R0 p3 m5 q& w        else inc A_i by 1
1 `" I7 `% N& D4 z0 w( [    end
# l- B: w( J  [/ u: nend  `. u& g! B/ ~  C! n8 x( ]: y6 C

5 o0 a, G3 K6 Zbegin P_pick2 arriving
4 g4 Q; |! F, K- M7 I- S( \    set A_i to 11
+ a. `) ^( f- c    move into Q_induct2
, x$ {' n: n* x) m8 x" B/ n    move into pickaisle.induct2( c9 h7 R' W% |3 c" X4 X! {
    while A_i<=30 do begin; H& o- ]! `, ]/ w1 L
        travel to pickaisle.con(A_i)
* Y% `$ L2 R% g, b, ~8 W# V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' k5 t$ h2 s8 R, o' ~
        else wait for 10 sec
8 S& z2 ~; l. Z* W5 {' C        if A_i=A_leave then send to die
9 Q1 q5 b' ?$ j        else inc A_i by 1" E2 m2 M" z9 j* @' s
    end
9 ]3 q& @. q8 U7 K' N/ \4 i" g% ~* Pend- |5 c2 x' T) ~* T" e& u) ]/ x
- |: p! ~! j. |+ H
begin P_pick3 arriving
& x% R- D, o- b- L" u    set A_i to 21$ _4 }4 i+ ?) s1 Q+ e* h
    move into Q_induct3
3 S! }  A. P6 {, b8 C4 q" d7 ^    move into pickaisle.induct3" S0 g. k, [' a; U* i# j9 v1 [
    while A_i<=30 do begin
; E: V5 [: }/ X5 ]4 ?, E% Q        travel to pickaisle.con(A_i)  h  O. a& F4 q) v* W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 H, |- h0 N+ H5 F$ M        else wait for 10 sec
( W; M0 M# R, m$ f! j        if A_i=A_leave then send to die
' T' p! ?7 U4 ~! N        else inc A_i by 1' ]/ {, v+ c( ]0 Q' \3 J
    end
6 S7 u- v3 `4 u# M/ Oend

最佳答案

查看完整内容

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是个什么东东?7 ]- S6 |4 q1 E* r. J/ H* M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ }4 |- s8 U6 `5 F6 z
& |3 T. r$ A" Y5 Q9 R/ j$ o8 a' N
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. z+ {/ R( Z- u- w9 \! t1 a! U: s3 x# |
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 y  Z6 b( b3 }1 ]
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' I. v5 ^2 z4 _8 s: V& g+ h
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. P% L# t; n1 u! ?3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 k& h. k" H$ M7 O7 e) z& c
begin P_induction arriving
0 p# \8 |; ^! k, @' H    clone 1 load to P_pick(A_induct)
, O$ H3 H3 L; C; Hend最大的系
1 O3 `% P8 e' D0 P  H
( W: G- g3 J7 D, Y6 wbegin P_pick arriving3 P! Q' ]  O- D. ~
    set A_i to procindex * 10 + 12 u# q/ O  [* F: k$ O' v$ e! @
    move into Q_induct(procindex)# }2 d5 g6 R# t2 [" q  i4 `
    move into pickaisle.induct(procindex)
; c# o2 S8 @/ ^6 l' O! p5 Q3 n' ^    /*check the type of pickaisle.induct(i), for your last problem.*/+ R" }6 Q5 Z  M5 ?# g" w

$ T: O  c& [( b# s6 r4 E    while A_i<=30 do begin
8 r1 N" w! _- u' `8 m$ F        travel to pickaisle.con(A_i)
& q" Z  x  B' t- _0 Z# {9 i/ h- _: e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ w! B& |  D( e8 U
        else wait for 10 sec+ l  j* k+ Q3 S5 q3 D
        if A_i=A_leave then send to die
& D. @8 ~; o/ W4 a        else inc A_i by 1
; l2 `& d: ~5 l3 V5 M    end
+ `+ q0 Z) a5 b: j: n) y2 Bend1 ]7 w3 x9 k7 n2 v
' G1 q& X: U4 n+ }- p
其中的procindex为整形,代表当前process的序号。' m1 A# N- D& m- _, Y5 s4 i" s) t+ 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-5 05:07 , Processed in 0.017365 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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