设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14545|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! f4 C+ \) _5 d- p/ d9 v4 _3 R
% k7 J+ Y- E8 y4 U/ k我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 b, H' M& U8 s; Z  W& M
. R  ?) D2 E; `7 R1 C8 N% e
begin P_read arriving
& A$ O0 p6 y4 z# B: r  ^    while 1=1 do begin+ V( X! k+ V: G1 A( E! B
        read A_tote from "data.txt" with delimiter "\n", E% z  z% s/ f+ F
        read A_time from "data.txt" with delimiter "\n"* f6 e& t% _# h5 J' G$ _
        read A_leave from "data.txt" with delimiter "\n"
9 f% |9 O# u+ H) y; `        read A_picks from "data.txt" with delimiter "\n"
7 h( W$ I9 g& l6 x0 {! `9 ?        set load type to A_tote" e; O# ]! U) ~; v' t
        if A_tote="tote 1" then set A_induct to 1
3 \4 h) h+ j( l        else if A_tote="tote 2" then set A_induct to 2
& @) k& h; d# H$ X- H            else set A_induct to 3   
4 C- n4 T; T; K! |# D  M        set A_i to 0
) S1 q  J% K4 E% i6 k        clone 1 load to P_induction$ r7 a5 W- g) o6 K& \: o
        wait for A_time sec
8 O5 ?2 b5 S3 a; o9 [5 ~    end4 ]! `( x. T! y. j
end( C; `) r  k  {: A) P- B
' Z# j- h" u  X# k  b
begin P_induction arriving2 s5 g! m( p, B1 u6 S0 f& i
    if A_induct=1 then clone 1 load to P_pick1
' I: M9 a. [" V+ X: r8 T, S( K0 e    else if A_induct=2 then clone 1 load to P_pick2* w' D+ b6 k! M0 a& Y
        else clone 1 load to P_pick3+ q/ }1 R8 m; q+ v7 p, s
end
$ Q, R2 |% L& |+ _
8 W2 g' ?5 r9 Z' E3 s& Ebegin P_pick1 arriving/ ^$ j) ~/ m3 E; h5 }0 }( }" j. t: B
    set A_i to 1/ [  p3 {! I7 k/ Q8 u* S1 z( v6 T: Q
    move into Q_induct1
. Q' w; M, D2 q5 y    move into pickaisle.induct1
# T4 _" `+ s2 r' s' f    while A_i<=30 do begin
3 f& C  M! X/ o) A7 f; Y6 ]        travel to pickaisle.con(A_i)# T, |  ?# b9 z8 B' t! F' ?" b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! `2 N, X1 m6 V        else wait for 10 sec
' I. ~4 K7 |, z  L5 ?        if A_i=A_leave then send to die1 z) N1 A& J, t$ {
        else inc A_i by 14 l4 b, b' D; A5 q8 h
    end
6 N6 B  a8 b" I4 y# }end0 r% B$ ]6 b" f2 R/ ^, y* S
3 n( y+ \. m* L9 Y: t0 U
begin P_pick2 arriving3 P' J) R8 b& B- Y
    set A_i to 115 {6 ]) U, N( h- c2 Y+ z
    move into Q_induct2
! j! L, \% {$ `    move into pickaisle.induct2( l8 L( i, E* B2 x0 d4 x8 k5 y
    while A_i<=30 do begin
' `2 `4 H8 H6 N1 w        travel to pickaisle.con(A_i)
% u; `0 B" a* `$ D% f: c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( V( R" a* B: P7 s
        else wait for 10 sec$ _: J- I! D& P" l% D. v
        if A_i=A_leave then send to die
/ G/ S% E& A# f  x9 ?        else inc A_i by 1
3 M" T" K' n* j( |    end
: w' E5 r9 o, Q/ K  p( _end
; _7 M0 j, B0 ^. x4 |! W7 m# B
* m- E) e/ M6 r$ [3 S% Jbegin P_pick3 arriving
) J* h4 D- o$ a! G, j9 ~# j    set A_i to 21
- {- e" e6 y: H. f* A5 n0 Q    move into Q_induct3
3 N& ?% `8 Y- g9 j; ]    move into pickaisle.induct3' u+ V  n& \& a) i
    while A_i<=30 do begin' m* V$ i& u/ j) W! M
        travel to pickaisle.con(A_i)
/ R# W6 Y8 P& i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ l% E( B7 \" a' t  I9 w9 D5 W( w        else wait for 10 sec% z9 I# [' z& U0 J- n" s1 k/ |, W
        if A_i=A_leave then send to die9 i+ d- s$ u' \9 ^5 M; @
        else inc A_i by 1
; p3 Y: u0 q; L, [1 Q    end0 }7 }$ w% C. |7 a6 S* P" _( _0 _4 Q
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是个什么东东?
) v$ x  v" l0 v- g2 `* Z6 z1 vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ A7 _5 j8 k; n
$ n( f5 Y7 U0 w. u* N& x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. l. w7 U+ A5 \2 ]8 ]$ ?
# Y) }# |) s, ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  ]7 d+ Z  C2 l: w* b9 B1 T# m- _1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 G& V+ e3 `' {5 I8 P7 N
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ [! Z- C0 y8 B8 x3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 Q6 N3 n0 _4 _4 O/ I, f* Rbegin P_induction arriving
& L! K' w& U- H# J3 C4 J* a9 Q    clone 1 load to P_pick(A_induct)9 r0 I6 Y4 [& d( G- h9 T! L+ m
end最大的系! I& A* n3 W, g) r2 z' d. u

9 k6 D6 _2 c3 `& W- o, m- ]begin P_pick arriving
% Q, a, t5 w4 ]3 l    set A_i to procindex * 10 + 1
0 J! W% j: h: r( a% p" P    move into Q_induct(procindex)
( M$ p1 n; j9 g8 @    move into pickaisle.induct(procindex)$ V) F3 b+ m+ G. O2 G1 p3 W2 k% S
    /*check the type of pickaisle.induct(i), for your last problem.*/
5 h, |4 u/ S0 `4 e3 F- c( G
: A4 B! F  E5 U1 c0 ~4 q% q  G    while A_i<=30 do begin
1 K, M2 L, H! Z* K7 l" ?( w" I4 W        travel to pickaisle.con(A_i)
8 p( ]: q/ F" z5 Q. O( L$ j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" }3 D0 g8 L! L, g/ k0 q        else wait for 10 sec
4 }# w  ^) x9 Q8 p! t- z        if A_i=A_leave then send to die
* u7 R4 j  W; F4 u1 ~        else inc A_i by 1/ D6 N! O4 T+ m  L1 \; S
    end, o2 N3 C8 P! _
end
3 M1 _7 B+ \3 @
3 E  I: G1 {' p$ {7 m其中的procindex为整形,代表当前process的序号。& C7 O; h+ L1 W: w1 L2 X' ]9 r$ r/ p
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-16 15:54 , Processed in 0.015598 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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