设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12460|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. U# H% b4 P) f
6 N, ?) R+ o0 F6 ^' F我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 K. M5 k9 ]  s. R7 Q4 J1 q1 j2 X6 d+ P
begin P_read arriving
- b- h3 n; _7 l8 t    while 1=1 do begin
2 W: j. f( B: y; b        read A_tote from "data.txt" with delimiter "\n"2 K, i9 m  q/ ~
        read A_time from "data.txt" with delimiter "\n"$ U+ }4 P" z$ N4 G3 g
        read A_leave from "data.txt" with delimiter "\n"
& v- E/ x1 z8 m: u. Z6 j. u9 J6 X0 s* ]        read A_picks from "data.txt" with delimiter "\n"
2 m  }) q$ z% G: r$ Z        set load type to A_tote
3 Y8 y6 a7 v- l9 F4 h* @        if A_tote="tote 1" then set A_induct to 1% r0 K: o' D4 ]. f
        else if A_tote="tote 2" then set A_induct to 24 F% u& [4 f/ e" a/ j2 p2 Y2 U
            else set A_induct to 3   
6 b2 R  j' l1 v/ v: X        set A_i to 01 F- r* ?  a5 ^) t1 J8 U( }
        clone 1 load to P_induction: c/ L4 a) M6 p# N/ V# A0 A+ t- N/ }
        wait for A_time sec
' s/ @! x, p3 U, {( C: P    end5 W+ c" W6 }' P( z
end
& ]: N3 q: o* K! d; x9 g: y- n9 _' H) f
6 o8 I, M7 e7 s( N4 n1 lbegin P_induction arriving8 X3 q0 N3 B3 i! X9 ?. s
    if A_induct=1 then clone 1 load to P_pick10 U/ e6 V% B3 M- {$ a
    else if A_induct=2 then clone 1 load to P_pick2
% U/ R0 ~) H+ m8 d& r; w  L( S1 f        else clone 1 load to P_pick3
* @9 w$ n; S9 {+ M; f+ ]end
# W3 ~/ b& J5 I) G: S% T4 J
2 u+ M. f8 `- C2 ]( k3 lbegin P_pick1 arriving; g2 c( ?( a! w2 i& y' [
    set A_i to 1! a0 V# g3 ~& [3 @0 C
    move into Q_induct1
$ [' h1 J$ Y1 y& B$ b& Y, U6 |. Q    move into pickaisle.induct1& p  q' R( e8 b2 B0 \
    while A_i<=30 do begin
1 o: k2 B) ]9 C$ O6 @- b        travel to pickaisle.con(A_i)/ F3 j8 C8 [: Q  g0 |9 @+ A+ i, G/ `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* K, E6 B+ W: u- |
        else wait for 10 sec! @" S+ w. ^9 F# P7 t1 k4 \$ h+ H
        if A_i=A_leave then send to die/ p" ]7 U; h5 w1 m$ F3 z
        else inc A_i by 18 B; T' M/ e1 D
    end: U# u5 G% |7 U1 X8 h
end' N9 f' A. w% o" W

; z) h; L+ `0 Ibegin P_pick2 arriving
* o  z8 N+ J! z2 _9 M    set A_i to 11
+ }" c  k& s( @" F) ~. U- F    move into Q_induct2
) H& X# _3 ^; k+ d. u    move into pickaisle.induct2; F0 F' l: R  F' T+ C; k2 @9 t
    while A_i<=30 do begin7 v* B# L/ r% W
        travel to pickaisle.con(A_i)
: z. y2 ^7 ?' k, q2 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 x* M( f% c: t' I  b% c# ?        else wait for 10 sec. o3 a9 X2 ]% }9 `+ v: @/ r- ^# o
        if A_i=A_leave then send to die
4 N% b! B7 W: B8 ~$ ?/ z        else inc A_i by 1
% F+ S7 d. d' g    end
5 n0 D( v( _7 Zend1 Q3 V7 M" A* }: [4 N& A4 e

$ V; |- Z, t0 M: ~+ Jbegin P_pick3 arriving+ _3 C5 V$ Y1 u) b( o% o: w7 m' ^
    set A_i to 219 v4 K: w  H+ w- I0 C% p: M+ z
    move into Q_induct3' o& Y, V. l- Y8 `( T/ T' n& k
    move into pickaisle.induct3. t) N( v1 `- P6 _3 v( o/ m
    while A_i<=30 do begin
) f- L# g+ `' D  z        travel to pickaisle.con(A_i)0 z7 s: {8 L9 A* q; w" l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: Y, x  r) i# v5 g" i! s        else wait for 10 sec
% {6 P- u6 L/ e1 z        if A_i=A_leave then send to die
# n4 v& Q0 u' p! a        else inc A_i by 1
# @2 K4 N3 q+ a9 ]5 r1 c- P2 q    end
2 n+ S( B' }, m: b# q2 c9 g1 O  Uend

最佳答案

查看完整内容

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是个什么东东?
' Y3 P& o1 j" z8 i: U+ v& V5 K$ @move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: Y# S0 @( y' C" N7 X
, }) C0 f* I: k2 d0 RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" ~- N2 f) Y( R' a! O, v7 V

$ r7 j3 r& [9 s  v4 ], R$ ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 p9 P5 c" d. J! i; b# t8 d1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 N  o7 [3 z  P* Z7 Y; q! r
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' T" I4 S& A3 D3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; I  u# q, d: i8 {4 L0 V% @begin P_induction arriving
% M( b& u, C- g6 g; \, F/ |* v    clone 1 load to P_pick(A_induct)
4 ~* {, ?, |* N. S7 b- ~end最大的系: S$ }0 s# X2 N8 X1 G4 y1 R

; B$ b, c3 n3 Q9 G3 E6 Ibegin P_pick arriving
3 O8 e0 k- e* L) P) E4 a    set A_i to procindex * 10 + 1
4 m7 F# _' }& I- B, l. \: s* Z, O    move into Q_induct(procindex)
2 x# d/ |3 f" U1 P  J" s4 L    move into pickaisle.induct(procindex)
5 {% Z% e( g0 r6 V    /*check the type of pickaisle.induct(i), for your last problem.*/  ]7 u3 G9 }4 W) G; E

8 V, l: o2 `! I3 i5 h: g    while A_i<=30 do begin& f" M" X1 E  |6 m3 @& G
        travel to pickaisle.con(A_i)
8 z& e" }7 Y  c7 ]# `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! u0 h3 e: M4 ?$ L        else wait for 10 sec; c7 U+ C5 [5 ^$ Z2 l
        if A_i=A_leave then send to die
7 M5 q0 E5 w1 u: i& D+ g4 f+ `5 u        else inc A_i by 13 |5 n, x% ~) H- i$ b! q4 x
    end) y' @0 @; C  A3 N: c
end5 S, S. ^) Q8 e  l3 l$ S3 C4 [& j

$ B* x( z* o% C其中的procindex为整形,代表当前process的序号。
2 {! Z, g7 y8 m1 {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-1-25 19:41 , Processed in 0.021934 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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