设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15605|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ^+ D8 W* i7 _* u% G8 A
) g( r: B" F+ d; y% v9 o我的问题是,在每个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, g2 c$ U: l; [
" K8 Z6 o: w% V- ~# j( Kbegin P_read arriving
0 P/ ?# ~5 _- q5 S! p" x  ]& G    while 1=1 do begin
" ]1 B0 e& m, x8 \3 W2 v        read A_tote from "data.txt" with delimiter "\n"8 V" Z3 P0 z. z, J' X
        read A_time from "data.txt" with delimiter "\n"' Q" U  `! \7 O9 L
        read A_leave from "data.txt" with delimiter "\n"/ k, w1 y% V9 x) j, e8 K( F
        read A_picks from "data.txt" with delimiter "\n"
# H! R, z/ V: ^! C! r; p        set load type to A_tote7 |! P% M4 u( s# d
        if A_tote="tote 1" then set A_induct to 1
; x3 E3 V1 j" y        else if A_tote="tote 2" then set A_induct to 2
# P7 c0 r0 D" }( S' I            else set A_induct to 3   
- {, q4 o0 P! M4 T- E  k  ?! v        set A_i to 0
3 H2 k+ `, W; v) O        clone 1 load to P_induction
8 D0 }) J6 k: ]# H* e& d        wait for A_time sec
0 Z! ]0 {% M- l2 M7 E# U# y: m4 @    end
% m; g1 C' g2 X  C; zend
$ m- y. n( n, f# ^
8 ~% R* X+ J$ P/ `begin P_induction arriving
/ C; j1 i5 ~3 F- w% j/ p4 n    if A_induct=1 then clone 1 load to P_pick1
7 j* G; W) q. ~6 U4 `    else if A_induct=2 then clone 1 load to P_pick2
" Y. z8 V+ M% Q" y& a' E4 c2 V( t        else clone 1 load to P_pick3
3 h4 q  M; G9 Y0 m! Aend7 ]% F" y1 g% G8 O0 O

/ G; u% y$ J  ^/ c* Q1 Hbegin P_pick1 arriving( n5 W2 s( m4 w5 S, B. w. ~) c
    set A_i to 1
6 x/ l! W7 I7 O) o7 g6 {. d) T9 z    move into Q_induct13 @4 D+ R4 f4 }" O; j0 P. \: K
    move into pickaisle.induct1# _- P$ f; o4 m! H9 r
    while A_i<=30 do begin
6 o$ q8 N% z* }        travel to pickaisle.con(A_i)9 h8 @8 X8 f$ h: G' R$ E1 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ R* U3 k" m7 M3 B- N2 M" k+ G
        else wait for 10 sec
+ b( `; T+ [/ L, y        if A_i=A_leave then send to die8 s6 \+ G) X# d
        else inc A_i by 1
( V3 q$ q/ k+ d% E- T7 u3 y( @5 x    end8 s! F0 k7 o' z! ^4 {
end
; o& a# e5 h2 X5 z* j% @. u  s/ P* V0 P! X& Y" C: {! w
begin P_pick2 arriving! I3 t3 B* v2 M7 f3 C
    set A_i to 115 T4 P$ e: A0 e, `9 l- q1 ~
    move into Q_induct2
6 K  _+ d- f* L* J8 B6 ^0 M    move into pickaisle.induct20 {( c- m# @+ t& G' @1 s& W8 d
    while A_i<=30 do begin
' v  }* K# u9 a! ?        travel to pickaisle.con(A_i)/ C# v) C0 Y+ Y9 a) E7 M# P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* P0 ?+ t; Q3 U5 \( Z% O. z, P$ F        else wait for 10 sec: _  D5 D% Y7 C
        if A_i=A_leave then send to die
8 y4 d# ^( |' w3 a; u. |        else inc A_i by 1" `% x) g5 y; g! k" _
    end7 \3 f/ u' X3 t; P. e+ G# o. }
end  f- ^1 }# l# h8 V* B6 [& f6 S

* w3 \; O6 j! C4 k3 z3 u/ ^begin P_pick3 arriving
2 S# P9 D- b% t  q- k    set A_i to 21; H; \. w2 Z( e) Z3 C
    move into Q_induct3: x( C7 E: K# ^. [/ y
    move into pickaisle.induct3
0 }! p+ l, {3 u/ ?2 D3 h4 ]# r    while A_i<=30 do begin0 q6 W0 l8 `! q$ R6 M# e
        travel to pickaisle.con(A_i)& m- x; D1 ~1 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: V3 d, a* z, e8 |& d2 n( f        else wait for 10 sec4 S# Y- q/ f# j, V( S& x% F$ j- h
        if A_i=A_leave then send to die- U; h% y! V$ e: H1 m7 i/ {
        else inc A_i by 1
; c7 v; C# J3 ~+ Z    end
! F5 Y! ~8 {3 M. n5 P4 ]0 x) I- P) Xend

最佳答案

查看完整内容

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是个什么东东?/ r( K3 _* s! \! R
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* T# @% M9 a& q& D) r5 _

! L, M% v. l  G( b" W8 m% sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- D* d6 [, x" }0 d' {6 |. ^
  k$ f* B: `2 {, @8 P- F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) s; K' M) }: k" J3 W
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 I- |0 Q* s$ {+ S  {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' O4 K* q7 _0 |, C4 T' K: J* g
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% n7 E, y0 C7 ~2 U; S! fbegin P_induction arriving
7 |5 Y+ }- B  Q. J( O& Z    clone 1 load to P_pick(A_induct)  l* A3 y/ W8 a+ c. q- D4 c
end最大的系
7 a  y# F9 a, C) D( [1 [' |! q* j2 A4 p9 a
5 h) v% j5 j5 @4 E3 gbegin P_pick arriving
+ Q0 h4 B8 |# Y; g2 R3 R    set A_i to procindex * 10 + 1
4 `, r3 a! V4 x    move into Q_induct(procindex)
" W+ u5 B7 Y& q8 u5 E, k4 y    move into pickaisle.induct(procindex)
' A3 I1 F: i2 f5 P* e4 L    /*check the type of pickaisle.induct(i), for your last problem.*/8 J( P2 }0 C$ t3 W0 O6 r' m0 k
9 m& n# d. M; a6 I, O& N) a
    while A_i<=30 do begin
0 m5 G' X* Z- Y        travel to pickaisle.con(A_i)' Q& h* M! I& s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" D: j( ]5 Z. {" ~5 \6 T& W
        else wait for 10 sec
( [  z. q+ m) A: p' x        if A_i=A_leave then send to die
2 z# I6 T8 A& v7 I9 D) d$ O        else inc A_i by 17 G+ k+ g9 H& t1 @/ h* s5 E  P6 d; Y
    end
5 G" |$ _: c9 ^$ A8 ]4 C! h! mend
5 e+ b  P2 m) b; i
$ b1 y6 d3 Q: U7 Q- N其中的procindex为整形,代表当前process的序号。
+ O. H) H! S4 h  C4 e# c3 Dstation和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-9-22 11:14 , Processed in 0.016441 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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