设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13567|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, ]( Y9 Q7 }7 z; y
7 G" y  P8 ^% x  _0 _; h我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* f! ?9 b- P! x' k# a& u
' j) E, j6 ^5 l% Kbegin P_read arriving+ H1 ~1 t5 n. E7 g
    while 1=1 do begin' m( h' o, a' A+ @( P7 ^  E
        read A_tote from "data.txt" with delimiter "\n"8 t4 I; E3 s# v! F; Q8 f& p
        read A_time from "data.txt" with delimiter "\n"
9 y4 I/ I( L4 J& W+ e+ I) ~        read A_leave from "data.txt" with delimiter "\n"
" r8 c4 D$ A  ?3 N        read A_picks from "data.txt" with delimiter "\n"
, N$ }0 t8 `9 y        set load type to A_tote; }; o& j2 B" l8 o7 |+ M1 v9 F
        if A_tote="tote 1" then set A_induct to 1* D# w& {# x/ A( o" [6 Z
        else if A_tote="tote 2" then set A_induct to 2$ L- s  a# E1 r/ w
            else set A_induct to 3    6 O3 z& ?8 ^4 ]
        set A_i to 0" F3 D) l3 @2 E. h& {
        clone 1 load to P_induction# `$ U% p/ N6 x6 F7 h: G2 \
        wait for A_time sec3 j" }$ l2 C9 G4 r, u
    end
) A; ?4 u" r* B6 Qend3 n. X, e/ g& A7 _; t) Z
) q9 r/ o" ?' L- d9 M1 ~
begin P_induction arriving- {7 R! C$ d( e1 z1 a, L
    if A_induct=1 then clone 1 load to P_pick1, @5 J6 _$ K+ t( L5 U
    else if A_induct=2 then clone 1 load to P_pick2
8 c" k1 t& \' g0 H- _+ L        else clone 1 load to P_pick3" O% m! O6 G( h6 r0 o7 V
end
* D! k3 Y) U1 G; V8 R
% a) t3 e  R% b. }+ [3 pbegin P_pick1 arriving4 c4 d# \3 |6 Z$ O2 I3 r4 l9 H: J' u
    set A_i to 10 @: ?& C1 C! ]8 C' k( f" l
    move into Q_induct1
1 }( U. p$ L1 z8 U$ E( j) S    move into pickaisle.induct1, F4 s- y+ v. ]5 ?7 S. W
    while A_i<=30 do begin/ z3 ?( V3 Y: i! v' s' H* @
        travel to pickaisle.con(A_i)
! I7 m& z1 W. R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 q* B0 m' q+ u6 w. T, A* {3 {
        else wait for 10 sec/ i3 D6 i% L, O% n/ j$ Y
        if A_i=A_leave then send to die. G& @6 J; g4 j4 X  h
        else inc A_i by 14 f- T: b) T6 E3 T
    end
! \" n, W% k" M* M; Lend
2 g) f  \6 M3 z! T) b/ }
/ z0 u& [) @& k# L- S0 e- j/ zbegin P_pick2 arriving0 ]- c: w- H. c6 L
    set A_i to 11
* q8 x8 O* B, T" V4 K% H, Z    move into Q_induct2
& g6 l* z: F! a, R4 L7 X    move into pickaisle.induct2
0 V3 [- {( S$ @8 i8 P    while A_i<=30 do begin& [/ l  N7 r9 c5 e0 ~' `( c" z
        travel to pickaisle.con(A_i)
; J7 h6 O5 o) A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 @* E) X0 [/ d        else wait for 10 sec
" X( r  d) p' S# M        if A_i=A_leave then send to die
  n( W  q7 ^, N4 @        else inc A_i by 1
! ?& a; U5 E( b( D. ]  X    end4 V( I7 R* p1 z1 w1 {+ Q" c' `$ F4 J
end1 ~; H1 i: B# W' p; L2 Y% v

# q! }" }% r% [: Y+ Pbegin P_pick3 arriving
1 G  I& U- k; T7 E    set A_i to 21' i) Q( P1 K: l9 C8 k7 n" t: Q2 \
    move into Q_induct3
2 C" h3 \6 M7 O% z    move into pickaisle.induct3( @1 N, {2 D( ]& T
    while A_i<=30 do begin* s! k3 M6 ]. b$ |+ _4 f5 q
        travel to pickaisle.con(A_i)
% v" e3 u6 Z- q; b2 L; x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: [" g. ^" |, l, s. F  k/ z        else wait for 10 sec+ e  N. [2 l6 l
        if A_i=A_leave then send to die
0 X! R. Y/ _7 i, I, ~% _        else inc A_i by 1
! X0 _+ p8 U0 w  X) a! [    end
9 ]7 P3 l6 X( }1 j; T( Z8 ^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是个什么东东?8 n& i* W: j2 X% J: d0 f5 C
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! V& m, x: O3 M9 `/ _1 ]2 f
( r/ e8 j3 l+ T3 }* E
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, ^9 ~+ Y0 \+ c( A2 R' v5 g& Y' v4 S) V1 k" B
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" s' {$ d+ D, |; l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, i, b! h# h% c/ K) z# }1 d2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  u2 n/ b# G4 O) w7 g- Q3 T5 ~3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: l. v" Q0 [5 D
begin P_induction arriving
" Z7 L% K* ^) p! s7 M    clone 1 load to P_pick(A_induct)
8 j2 `1 |% z5 |: s! K; Aend最大的系5 G7 L2 X/ y& F, v9 a0 h& g
3 s2 i3 M; s. x+ B, G
begin P_pick arriving3 S0 R+ [9 v. B% _4 ?
    set A_i to procindex * 10 + 1/ c) d6 J* @; I& ]  j' w
    move into Q_induct(procindex)" B5 `4 f5 ^5 N; T) Q6 r! G
    move into pickaisle.induct(procindex)
" d# S2 A4 X" e  V$ h. @0 U$ w& x    /*check the type of pickaisle.induct(i), for your last problem.*/
0 y' Q0 X6 k* E6 F7 m1 _9 f8 [; c9 R
    while A_i<=30 do begin
( T9 G1 _& t: U. h/ m- b" Q        travel to pickaisle.con(A_i)
$ T5 @! U; W- O" I6 k. B7 D9 Y* M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 o* i: }% c! E( q6 I- k  t- o  F
        else wait for 10 sec: T2 V6 Z# V) |$ }, y
        if A_i=A_leave then send to die
  _3 ?/ X6 J& p        else inc A_i by 1$ x) D9 e' i, a, {' D* q6 J1 j+ h
    end# |! _+ U( _; |; Z9 ?
end. r0 B( _( S" z

! C. _3 }( h5 {( U其中的procindex为整形,代表当前process的序号。5 M$ b& H2 i5 I: |3 [
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-4-21 21:11 , Processed in 0.023668 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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