设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14619|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& Q  y; \  a: g- d
* t. N0 Z/ ^* X. W* M* W( O/ C' R: `9 G
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# J1 r" I9 h* S& q( s$ I2 t

" l1 A9 }" f* P; J; sbegin P_read arriving
0 g. ?; R! U( F5 }# L! r0 p    while 1=1 do begin
# x3 z1 @5 C6 Q) P& \" k        read A_tote from "data.txt" with delimiter "\n"
6 I$ a7 K) v6 @0 u0 @        read A_time from "data.txt" with delimiter "\n"
& k/ M5 l3 o7 @* w        read A_leave from "data.txt" with delimiter "\n"
8 i; D2 G3 _7 m1 [6 @0 U        read A_picks from "data.txt" with delimiter "\n"
4 S. d& j! t8 A; q# r  a! Y. d        set load type to A_tote
# _5 p, Q6 C7 I) ]# t        if A_tote="tote 1" then set A_induct to 1
- ~4 D1 h8 {* o0 ^  W9 U        else if A_tote="tote 2" then set A_induct to 2
/ R: x* o) p; E4 o+ y            else set A_induct to 3    + e' g/ `' Z1 `8 h+ ?
        set A_i to 0
3 W6 a- S/ D- G5 s; a) E1 U        clone 1 load to P_induction
1 n, y: w/ E" R4 n5 ~        wait for A_time sec
7 \+ K& L8 H! I3 S# q* ^    end
/ L- x+ v) {4 R# P8 H+ zend
9 e( Y# t9 h7 o$ Y
* k, b1 F2 A8 |; T# K2 \begin P_induction arriving
0 X4 Z  {, n" X    if A_induct=1 then clone 1 load to P_pick1
; S$ I+ ]' s* b3 e" X6 g5 [- c    else if A_induct=2 then clone 1 load to P_pick2( b, X$ {$ t2 x# N/ h6 l
        else clone 1 load to P_pick3
7 |* F' E! R  ^end* M- U0 Z9 N# H* s8 X; K

( v4 \* s( H$ L* N3 K; |9 l6 Obegin P_pick1 arriving
, @0 |) b1 o, F0 y) a    set A_i to 1! M1 z8 b  M' r; Z7 j
    move into Q_induct1
! X$ }/ _, s4 c, \, Y( [4 Q    move into pickaisle.induct1
4 n" C8 f% Q2 [( F7 i  Z    while A_i<=30 do begin7 |# \3 ?! V9 y/ h, C, {5 w7 c
        travel to pickaisle.con(A_i)
* O# v/ [7 K) X. F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* b' I$ `4 D7 p/ @+ L
        else wait for 10 sec+ y& F# e3 d" Q/ f: L, d
        if A_i=A_leave then send to die5 H1 ~( I2 r6 P
        else inc A_i by 1
. n) F- l) l' g    end& {" {7 o1 W9 L- |! f. b
end
! G- Z, d. s& n  H$ |7 Y% K% R, e3 `/ A- t4 ^+ ?$ z
begin P_pick2 arriving* O+ r; t, Z" q4 e" D5 N( D* O3 z
    set A_i to 11
7 V  ~% V; ^; h" B9 y, ?2 y; ?7 \8 w    move into Q_induct28 l* L# |( S" j- _+ @
    move into pickaisle.induct2
( u( @) q% T6 s9 e: v& p8 S/ H8 c% U    while A_i<=30 do begin
) g4 e8 V; ?1 P* ?: K6 h  G6 p7 n        travel to pickaisle.con(A_i)
* a& _& H9 b, U! `4 _4 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, s4 I- k; {( I6 L! f6 ?  e4 \
        else wait for 10 sec; `# b0 U2 @8 Y) q0 e8 @/ P& z
        if A_i=A_leave then send to die
: H- }; u6 a  D$ J* t# |        else inc A_i by 1* i$ S, s8 G, |, A3 {2 y
    end
6 i- R% m& E2 ]$ c$ a+ Iend) @( \0 w' I. U
7 ~( g6 `, e9 L# o
begin P_pick3 arriving. M7 E9 b3 z, D% t  e9 ?
    set A_i to 21+ n/ Q; U, ?; ]6 u, P
    move into Q_induct3# a$ x8 G7 {7 v3 h: F+ q
    move into pickaisle.induct3
7 R" [+ ?4 g$ j! `5 |: L3 z) L+ c    while A_i<=30 do begin+ V5 q# r5 h1 `% A5 e. ?
        travel to pickaisle.con(A_i)
# u( c# k: {; |4 R* G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! _) m; [5 X1 r0 e. F; o% p
        else wait for 10 sec
, R, w- I+ R" `2 s8 \) H, {& E        if A_i=A_leave then send to die
, B( b, H1 X0 _2 L8 Q* a        else inc A_i by 1  m5 P$ `2 u( A* M* q! V
    end
' O5 P/ B5 K1 \; K$ ^9 A/ F1 _/ `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是个什么东东?7 u% S4 J* s/ c. U  l; i+ r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ z* f4 Z; x/ S; ^$ ~" u( _6 L: s. I4 j: p& w# |% \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) n2 H, P8 j4 ^$ P2 F3 g9 s4 a. L6 z$ \+ P
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  g: l+ I" W) K1 Y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 r$ [5 y1 e' W1 m9 R; _! Z+ S
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, H; P2 p# j/ p- ?7 S" m1 A% L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) |2 O& X/ h: L: z) N0 l7 b, Q+ sbegin P_induction arriving4 M2 M) I; m# a0 [2 t
    clone 1 load to P_pick(A_induct), _8 v% `6 A# v* _0 T/ P6 J
end最大的系
1 J. o3 {& w6 ~# Y: j& O2 h. S! t
0 i- f/ W# H0 I) h4 ^) D9 ]9 lbegin P_pick arriving8 `& l4 c6 C+ G) F5 n
    set A_i to procindex * 10 + 1
5 d- I/ x" _- `1 F. i3 \    move into Q_induct(procindex)
! e; y0 t( |% h- M    move into pickaisle.induct(procindex)
+ ?4 p  w/ _7 s! S% U    /*check the type of pickaisle.induct(i), for your last problem.*/
: j, h* A$ A$ b4 o1 Q! b$ P. O( R: J! c+ D8 E2 b
    while A_i<=30 do begin
- Z; c9 s% j% ]        travel to pickaisle.con(A_i)
; U( }, Z3 w- I$ u' h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 _/ P- U) I3 y8 k7 b        else wait for 10 sec
+ W( K' P/ `6 q. z2 [5 j        if A_i=A_leave then send to die; O( N6 W0 s7 k" R
        else inc A_i by 1
$ f! `& Z. p$ x7 S6 C3 i    end. t9 H0 Q/ v. H
end
/ h# m+ y* {5 j9 b! b* a
0 `/ C9 Y$ v1 ]: L% T; U* i; Q  q其中的procindex为整形,代表当前process的序号。" ^9 p% g+ C: z' O! W
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-18 17:23 , Processed in 0.014746 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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