设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15220|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: ^4 z; I/ y' d3 h0 W5 p0 g% D
2 q# N6 J+ H% ?1 P; r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ _) v* s# J6 d9 N( A* B
+ H! z! O: [* b0 t! f' u# ?begin P_read arriving
- d9 T1 _$ y& p5 [" ^5 B    while 1=1 do begin
9 U" o! ]# z9 A5 b# [        read A_tote from "data.txt" with delimiter "\n"
# f& z( p% h% z" V. c        read A_time from "data.txt" with delimiter "\n"
2 l, S2 I) L- y, H5 `6 M- Z& j        read A_leave from "data.txt" with delimiter "\n"; e- c, m4 F, O, E! b. H
        read A_picks from "data.txt" with delimiter "\n"3 n+ t9 B) f9 X
        set load type to A_tote+ W3 K! B. u# c* h  v, Z
        if A_tote="tote 1" then set A_induct to 1
. w" B1 ]+ X* e* I- D3 a  i! C9 f- ^" H        else if A_tote="tote 2" then set A_induct to 2
5 L+ v/ j  _, h  r3 D            else set A_induct to 3    8 o- v* F3 Y& M& R
        set A_i to 0
& S6 N! i1 V4 M7 v        clone 1 load to P_induction+ X* N8 m- n! @7 g
        wait for A_time sec
; e) d, k  D4 d! F, Y  H+ d    end: x7 G2 l1 F* z1 C3 Z3 M
end
7 g# \  r- m5 V! n, O
, @- I+ _; \( Z* O2 abegin P_induction arriving
1 h* s# M  P) R+ H" h1 U9 ~9 I    if A_induct=1 then clone 1 load to P_pick1; g. `4 `8 C6 j; }/ @1 D
    else if A_induct=2 then clone 1 load to P_pick2
- f+ a( V% L7 b6 o2 W. ?        else clone 1 load to P_pick36 N* X; z* j+ r& s1 O/ ]% }) W
end
% b; {. t8 U4 Z) M  c3 F  r! N6 S
+ ?8 B8 k5 E* ~4 xbegin P_pick1 arriving
" t, l5 H) M4 c    set A_i to 1$ ?* W) V" Q! m
    move into Q_induct1
: U7 s5 W8 ?/ s$ T    move into pickaisle.induct1
" A1 z0 j" ~  u5 {& @    while A_i<=30 do begin
3 D3 E5 _1 R) g' {# A        travel to pickaisle.con(A_i)2 V: p  M- k) f0 E! n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ], V5 D) Y$ r4 x2 H( g. n4 _) w        else wait for 10 sec
+ g7 Y1 i  x# G: p8 L" D        if A_i=A_leave then send to die9 }3 x3 L* A! ^, m6 p0 c  s
        else inc A_i by 1+ F4 @! ?/ I  Z0 r0 l
    end) h6 i4 `& V2 ~; d' r) R
end
- k9 X" }* l" S. O1 N
: D6 Q. z: v+ _  Vbegin P_pick2 arriving
% d$ l0 |- Y! O2 P, A9 T" [5 ~5 E    set A_i to 119 y: s! t2 x+ O4 n% L+ r* q- Q
    move into Q_induct2
/ O5 v: f+ q# j  q+ I+ w; e    move into pickaisle.induct2
4 E  o1 B4 Z2 U7 G% @    while A_i<=30 do begin
$ v! G. Q$ m) k; A  ]+ i        travel to pickaisle.con(A_i)
8 p  y. l' m9 a5 l" i  \: _8 l0 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 d! J% @) S/ _# ?$ a
        else wait for 10 sec
- o7 f  W6 |6 u        if A_i=A_leave then send to die
" H  ~3 b% k7 C        else inc A_i by 12 q9 t. e& M9 r8 m" M4 R* f, _
    end5 m  I; H- A# ^  `+ T8 f' ]
end1 t  B$ p- a6 v6 r  E& G: p

4 O! y5 K$ c3 ?* R' e7 L7 ibegin P_pick3 arriving* [) h! P, F# L- d4 a' s
    set A_i to 21* S! j# \* C: N" b; Z* K  m
    move into Q_induct3
1 m) j& b4 }# J* m9 w5 \2 [    move into pickaisle.induct3
0 d, [; b. O( J, h9 f7 |    while A_i<=30 do begin" ?5 ]2 }% ^( f% u1 \
        travel to pickaisle.con(A_i)4 H6 D  B% k7 u2 }! u2 H  ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 G$ q4 Y$ f8 p- T/ b$ ~: ^3 k        else wait for 10 sec
/ \) z) ~# S$ d3 g; V6 t; l        if A_i=A_leave then send to die9 l8 A* [5 p3 S9 Y, y$ s( m
        else inc A_i by 11 r$ Z& s( ]. G# |( E' G
    end
8 s4 V' V. y7 `7 O4 p/ iend

最佳答案

查看完整内容

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是个什么东东?: l8 ~+ ], x* q7 F3 \% `( j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) p2 ~: c& E+ [
/ p4 f  p9 u! p& w& |* q5 Z5 N  u. o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: y. a( J6 B7 a" A

6 a- y$ x' Y9 s# q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" B3 h4 p0 W7 H: N6 S4 z$ D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: Z; b& z; P! P9 N8 E; T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* R7 z6 z9 w9 P( y: _7 {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 f9 E& v8 o; }2 e9 \
begin P_induction arriving
, A# E; X( l0 z: U    clone 1 load to P_pick(A_induct)
- ^. C- G1 A' l* i- h" }end最大的系9 u7 }2 M1 u- ]% Z. a
' p- v( i) i7 E/ b
begin P_pick arriving* w4 p/ A! |9 T
    set A_i to procindex * 10 + 1
9 ~* _) g) N7 v7 d" v$ ?    move into Q_induct(procindex)
& r. E) T8 I# H2 ?. E    move into pickaisle.induct(procindex)4 U8 D  n0 X% g$ Y7 E- U
    /*check the type of pickaisle.induct(i), for your last problem.*/8 e, S# a1 `% `# y9 O: @
  W$ o) ?5 R* M" K6 U2 Q
    while A_i<=30 do begin' v( l" z) J6 U, \9 [% E; Y) j
        travel to pickaisle.con(A_i)
) {/ m: D6 V: N9 j& A: n# |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 T/ h! L' k5 }9 b" T. A1 ~/ m0 |6 k% X        else wait for 10 sec
, @- g  h/ ?2 j* M; z( e        if A_i=A_leave then send to die8 _8 u% I  ~% Q# H" _0 d7 z
        else inc A_i by 1. }1 j! _/ R8 c8 t4 ~1 ^
    end" Z# s9 F* a- i  x
end5 i, t* k9 {1 x6 d4 T: @( B; q" |
# w4 I; p2 }( G2 D6 a+ L0 G; J8 J' p
其中的procindex为整形,代表当前process的序号。+ m8 P: I& M4 N6 K
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-24 19:42 , Processed in 0.020991 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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