设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14307|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 _3 K/ D/ [9 w9 H4 i( d
3 @3 a" r5 b- _( _3 d9 x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* X! C$ L' {7 r# o5 Y5 K' f- {8 w- N
begin P_read arriving
1 H* M0 V- N( D& g1 h# |    while 1=1 do begin
  c" N! b/ G8 L        read A_tote from "data.txt" with delimiter "\n"
' u% N. f, E& W1 H        read A_time from "data.txt" with delimiter "\n"7 |( {, r0 y4 Z- l0 U: o- y
        read A_leave from "data.txt" with delimiter "\n"
/ }. i" T9 ]( d4 ^        read A_picks from "data.txt" with delimiter "\n"6 V6 F3 X* @( L; |; w
        set load type to A_tote( z( ?* P! {3 X' {% q& Q$ j
        if A_tote="tote 1" then set A_induct to 1$ a" B8 _+ d2 H- r& c
        else if A_tote="tote 2" then set A_induct to 2
8 h, f4 K: _# H            else set A_induct to 3    6 k1 L; d2 R. f5 S
        set A_i to 0
& E1 P! }' `9 f0 [" P7 @) v        clone 1 load to P_induction
$ H9 J/ b* q# N3 C$ E        wait for A_time sec
" u: P7 E) x( P& L    end9 j* X0 l3 M+ s6 S8 J; d. i
end
4 K( {# o. m' ?9 w
4 B' c$ N4 y  Z( N* l% c/ H( A$ b/ Vbegin P_induction arriving' L9 j0 I4 h) l4 i: y3 |
    if A_induct=1 then clone 1 load to P_pick1
) _5 P6 V, j& Y* w% H5 H, o1 \! T5 q    else if A_induct=2 then clone 1 load to P_pick2# a2 m; q  g6 z# S9 S' @' Z( x! ]
        else clone 1 load to P_pick3- ]+ n" X! F' q
end, O2 }7 ^( \/ ]+ c& K/ u
) D  d- l1 {* ?+ P5 j. L4 Y/ x
begin P_pick1 arriving4 b4 F: f8 O' U  X" [3 M
    set A_i to 1  R' X. n3 q- a' ?' ~
    move into Q_induct1& M! O# }- X& }9 j" Y- w
    move into pickaisle.induct1
; l& A3 X3 F% N! k/ ^; T! j2 Q    while A_i<=30 do begin
7 K  p1 ?# ]5 ^9 F. ~! b0 d9 n        travel to pickaisle.con(A_i)6 \& [6 ?  g. t, L8 W, I2 p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 c7 q* Q5 v8 N$ o- e% K; ^        else wait for 10 sec
" y3 ?' G% Q8 ?4 H1 m1 X        if A_i=A_leave then send to die
& e+ n6 O/ M; x2 E( ~* x        else inc A_i by 1& r6 \+ v$ d& |4 g7 O! {; B
    end) r$ [0 X" D2 q6 K2 o5 g
end) c1 _; e' A2 a: I

: p; P2 b9 O3 }$ Bbegin P_pick2 arriving
! n1 S/ @- @+ ~4 B, z    set A_i to 114 U* z1 l  {9 J4 {. c* _) n
    move into Q_induct2
" @8 h* g) g; z! Q( i- X$ I8 a    move into pickaisle.induct2; i" H' M" [; |$ L4 y
    while A_i<=30 do begin; w: L0 f- T5 i( A
        travel to pickaisle.con(A_i)
, ~. z9 Q' w; o3 H/ ?/ t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) o" G. i) A! j1 N8 B4 P
        else wait for 10 sec
% c) S* C! F" y0 C$ I/ V$ J        if A_i=A_leave then send to die7 ]0 T3 S* e; T' J4 U( k
        else inc A_i by 13 L! ?0 z; a# y- \3 }3 p/ _
    end
. M; U* v4 T1 L& }7 ~9 ^0 rend
7 L; A: Z% O0 M# w+ C6 d: |+ _3 `- u0 t( m/ ^
begin P_pick3 arriving+ y* P* \% N0 N: `/ R9 Q
    set A_i to 21
. e. o. T; B7 U6 S+ j, S( Z1 T) _- T/ _    move into Q_induct31 }, f5 Y% w; M; h* I8 O' p
    move into pickaisle.induct3$ E' G; e& W1 U
    while A_i<=30 do begin! M$ G1 @2 f7 D6 W: W9 p
        travel to pickaisle.con(A_i)$ u2 z/ a; L5 K* d1 L% {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: L! |# d  M/ v  p        else wait for 10 sec
5 }9 V, g) ]6 N3 i6 L9 s  m# q        if A_i=A_leave then send to die6 G0 h  z, Q2 }7 B) C% z: c: E
        else inc A_i by 13 p2 G8 {. n6 k( {+ C8 X
    end4 I' e( j% D% i* E, V$ ~$ L
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是个什么东东?6 g# I3 l+ c( o" H
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' E: @8 d( C  i* L  @' E
+ u7 ^( J' W3 N( W3 P* AAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! o. u* b6 r0 m2 B7 w" {
3 E  ^4 d( S# b% `" D0 s另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( ?; u2 F3 @% e9 ?
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# O# n5 L& k' j9 s3 P( T1 f: R! W
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 {5 V- x2 {- u! ~  Z( r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ k; ]3 n( A$ T* A9 l: J
begin P_induction arriving2 M. K4 ?  p$ r. Q, c8 {
    clone 1 load to P_pick(A_induct)
/ k6 e$ F# i" c5 x: Q& m2 mend最大的系
% g  q* W& z# M( b, N* o
" h8 o, a3 }: l* j/ p0 Jbegin P_pick arriving* H9 j  t- P( x. l  l/ C" E7 \
    set A_i to procindex * 10 + 1
% t( u9 A- G$ s4 B: ]    move into Q_induct(procindex)
2 F  r4 N( K8 O8 w    move into pickaisle.induct(procindex)
7 m( R' {4 s3 t- |+ k9 i5 c* t    /*check the type of pickaisle.induct(i), for your last problem.*/
1 X  |3 T9 p* s9 Q- s$ g) H
4 o, t9 V5 o4 i    while A_i<=30 do begin
/ o& c0 Y8 U4 [; S2 K. P        travel to pickaisle.con(A_i). t6 T6 [+ `2 T+ q& |. D- x: T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" X, j+ g6 D8 P* M! _        else wait for 10 sec
7 E5 u( R4 K6 ]- E1 f        if A_i=A_leave then send to die
  e( B  m. O; q4 c* d1 P$ _5 ~* N        else inc A_i by 1
, U2 V+ }6 X' X" b# ~% _) e    end
, k  Y0 @6 `, w4 r$ nend
; J  J; d- n+ R$ v
& g3 D; r" q2 K  M+ ^其中的procindex为整形,代表当前process的序号。7 Z7 e; x7 V. Q" r4 B; ^6 ^1 q9 o
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-1 02:12 , Processed in 0.018012 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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