设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13366|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 `' x- n1 ]+ [5 P5 }. m6 Y# U, A
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. `4 }; O$ X! V" n: y; m
( w, u; J4 y" L
begin P_read arriving
8 A" e( B& b/ A& Y# o    while 1=1 do begin
) |+ I! ?4 I8 H        read A_tote from "data.txt" with delimiter "\n"2 q, W, |3 t1 ^* J7 _3 m  C
        read A_time from "data.txt" with delimiter "\n"
+ {( n) o* a7 B2 A/ m3 j  f% G, c        read A_leave from "data.txt" with delimiter "\n"
5 P9 r  D: F0 R( b- J7 w8 l3 q        read A_picks from "data.txt" with delimiter "\n"
  g6 O$ ^- u: V5 q3 S  [) L* ~        set load type to A_tote
, W+ Y/ D0 f- h5 _( d        if A_tote="tote 1" then set A_induct to 1
) Q0 w: a" ]: T- O, Q6 F        else if A_tote="tote 2" then set A_induct to 2
2 F4 T/ T4 {4 V4 W  {9 I            else set A_induct to 3   
/ r5 C, n6 g. B' a& L- P6 B        set A_i to 09 c/ J& N/ v9 U; h
        clone 1 load to P_induction
5 G% T0 H4 |8 \3 c' a) n8 ?        wait for A_time sec
- q; K! K: R, s5 E8 [2 @    end
7 n5 }/ x3 l! w; {end% O" O9 p3 q. _% s* G

/ S; y; F3 i% g: Z2 Ebegin P_induction arriving" ]: `6 c* O2 O9 S
    if A_induct=1 then clone 1 load to P_pick1% c3 b: L! W/ h
    else if A_induct=2 then clone 1 load to P_pick2
& Y  e  M* f; b: H" v/ G        else clone 1 load to P_pick3( }: K( N, v- Y) f
end
! S$ A4 x5 M  l
. x+ r+ U( R1 i# k) }  n' ebegin P_pick1 arriving3 X0 x9 c, p+ B! K6 S8 R' N5 W
    set A_i to 1( i% Q0 A7 Q& c+ u& Z
    move into Q_induct1
0 U* S- R# w; F0 j6 W$ P, a    move into pickaisle.induct1
+ ?. L7 V% y8 e: v- d  P- k% `( L    while A_i<=30 do begin3 |6 u3 u9 y0 \* }- m, D+ I
        travel to pickaisle.con(A_i)/ I) ^, f; N7 L( W* e7 q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% k: a7 Z4 ^- m& Y, E
        else wait for 10 sec
  {( }( c6 k0 c* H. s+ ~  v, g( Z        if A_i=A_leave then send to die' m( d* m( }; v' Y
        else inc A_i by 1( `' f0 U! Y' g( C
    end
: A* f+ m6 X! j* nend
$ s! b+ R! `4 D
" \0 B$ f" z: y) \; f% ]" Ybegin P_pick2 arriving
! \4 t" u  C0 o- P8 m1 t1 q    set A_i to 11( P# \: C5 {/ R3 o, x
    move into Q_induct2
, _' l6 V( g" T9 Y    move into pickaisle.induct29 Z2 r) w9 k3 v; G
    while A_i<=30 do begin
! K3 S; `  ^% b- X7 l% z* H        travel to pickaisle.con(A_i)5 w0 x: s4 b) y& `( _5 Z1 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  z3 p3 B8 v4 s- Z+ j, I- u        else wait for 10 sec$ L5 y: f! X4 L7 m3 c: O1 @
        if A_i=A_leave then send to die
* r9 `- D5 K& j8 v- }# v4 R0 Q        else inc A_i by 1
" k$ Q4 n* c; T1 i$ B) ]% A    end
( i4 B9 M, Z" `' S# ?# @3 pend
* c% I- r) D2 @6 T1 U
0 l! ~6 v: g9 Z9 w1 A  w+ Hbegin P_pick3 arriving3 [2 R7 }8 [% Q+ m1 n# j0 w. {0 g5 f
    set A_i to 21
7 O# `' m3 z3 t( p- K    move into Q_induct39 h/ q5 X& t$ Y. T' o  ~! V  \
    move into pickaisle.induct35 t  X0 s: m/ _9 s2 R  o: p
    while A_i<=30 do begin
& O5 Q$ R& t, [% s        travel to pickaisle.con(A_i)- l! ~5 t+ Z0 G, r! D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# m+ w- Y: ~- u8 n+ G2 E7 S        else wait for 10 sec
4 F5 |/ s( i) _        if A_i=A_leave then send to die
4 _# A8 |7 T. \0 y! i* g        else inc A_i by 1. l2 q4 S3 C4 T7 [1 Y1 t5 S$ P
    end5 O6 T6 M2 _8 j" u* k% u
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是个什么东东?
+ w8 k( H9 K4 o+ G9 \+ fmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, t5 ~- S7 u; n  M
2 I+ O  G) r2 K  ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' h. u! b9 a  F  U( s' R

/ @4 t4 j+ Y0 I3 ?1 F9 d; h1 s6 }1 X另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ F4 E3 x( Z+ ~. h" }1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# T4 q) F' k( n, @0 Q, a# O
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 }5 G/ G+ Z( x9 Y# s2 J+ I# m3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 a1 X( a% F' C' j6 U# S) @8 K
begin P_induction arriving
4 K) r  n9 z4 {' W( t    clone 1 load to P_pick(A_induct)1 W- f* d* D( ~+ |' l: @
end最大的系" i# H" m4 c; q/ e) o# X7 X) v- p4 Q& J

6 C# C4 \& C4 [+ q8 e& Ibegin P_pick arriving) d) t, O8 {4 _% v  u* a
    set A_i to procindex * 10 + 1
( p; z( n" E: I5 i' l    move into Q_induct(procindex)
8 l5 o% D1 P  x" F, F/ v) |' `  G    move into pickaisle.induct(procindex)
( X  @- _5 t# O+ ~+ J9 @    /*check the type of pickaisle.induct(i), for your last problem.*/
0 r' r4 \1 [! u" z' [- ]5 o1 {! U2 D& S8 k& E& N& I2 v- p
    while A_i<=30 do begin
! ^. S8 k; p2 d+ n" G        travel to pickaisle.con(A_i)
- C4 k2 Q" g5 A: e9 k1 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  y1 Q4 L" T3 o0 b) o8 x9 s" y        else wait for 10 sec
. _6 a+ l; v0 b+ z* y% V) I        if A_i=A_leave then send to die
- u" v/ e% ^( Y* \* `0 a  w3 F  z        else inc A_i by 1
: P' k/ M+ a2 ?# f  ?    end
+ n* f3 B0 ]* H; m9 N$ I$ cend
* `9 ^, {$ B8 b2 l# \* \2 @' c; E; l  M; f7 {2 J
其中的procindex为整形,代表当前process的序号。
5 p; s6 s1 {! f4 J/ D9 v3 M! ?! 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-4-7 02:50 , Processed in 0.018332 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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