设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14361|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( }/ |& r# _$ H9 c( }% I; L8 N& x6 O& A( h! s/ h' n" O# P' r
我的问题是,在每个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 U: Y: n6 D. x

, T6 O( S3 m' k. jbegin P_read arriving' q  @& _( h* C' H/ e
    while 1=1 do begin
3 N1 d0 h3 @! X3 v  S        read A_tote from "data.txt" with delimiter "\n"
# ]) P1 D$ l; b  q% l* T' C* ~/ b        read A_time from "data.txt" with delimiter "\n"( u; N0 }& _3 u- |" o( T7 L
        read A_leave from "data.txt" with delimiter "\n"# V+ B& |7 F4 Z: ]3 V/ ^: D
        read A_picks from "data.txt" with delimiter "\n"$ G8 l" ~( I5 p: Y3 w# S
        set load type to A_tote
9 p8 L0 a' p% @. G        if A_tote="tote 1" then set A_induct to 1% w9 j& q0 C& L4 K' ~) M
        else if A_tote="tote 2" then set A_induct to 2: D( _# b1 r' r
            else set A_induct to 3   
3 w+ v( }% w' q, v9 |        set A_i to 0) N8 ^7 H, r7 {1 A3 N6 v
        clone 1 load to P_induction
9 D- g! D% u2 h6 \        wait for A_time sec
! ]8 H$ @: R$ {1 M8 f    end4 z0 U; U  a- w! H% q
end6 @9 A9 s6 Z  M
) y# o& d0 O( L  ~* D* y; b' s
begin P_induction arriving: k% S0 A  P  @# F  A
    if A_induct=1 then clone 1 load to P_pick1. b9 D/ @5 O7 y
    else if A_induct=2 then clone 1 load to P_pick2
( Y3 ~& |% |  u: y0 L$ `        else clone 1 load to P_pick3
  H- k# @+ c3 I5 Oend) p/ B$ S8 k4 e$ w2 X; [

' D8 a% x+ g3 g- L' ]! B9 Qbegin P_pick1 arriving6 k2 @+ X3 `4 Z) }1 v' T: ^
    set A_i to 1
/ g- G4 a/ j: V) f2 ^    move into Q_induct1& Z, H, @" B1 J" Q# v8 C9 F
    move into pickaisle.induct1+ o, Z3 P, m2 F0 s; c7 a
    while A_i<=30 do begin" {  o8 l2 E# G" T2 e( B
        travel to pickaisle.con(A_i)
/ H& q! o, c5 V8 f" g# Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 ~( O% x8 y5 I# p; D& m
        else wait for 10 sec
, W/ e# V2 s# c7 O4 W) z1 g* l- E6 R. ?        if A_i=A_leave then send to die, b) [( [& l8 d
        else inc A_i by 1
; O5 d% Q  ~2 a4 ?# t    end  ?# J6 U5 o2 B) D3 Z8 L# L- x
end7 E2 [1 k2 n! A+ h: h( N# }
% W- _8 R4 D0 g, Y
begin P_pick2 arriving4 a. p4 _6 a5 ?# \' `
    set A_i to 11% i  [" l" q4 x2 ~1 _
    move into Q_induct2
! q3 [8 x) N/ }/ H( P$ v    move into pickaisle.induct2
2 M1 s4 L! T! i    while A_i<=30 do begin
' S  h: T  u( V5 n        travel to pickaisle.con(A_i)
* p5 E0 Y% k' L2 A- Y) `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ]3 I+ j+ D  r        else wait for 10 sec6 R% ?* X, Z4 W, T$ V
        if A_i=A_leave then send to die
, O  j* ^8 d3 d. n! v% {7 {        else inc A_i by 1/ q4 ~& R# d) z* i" g3 L
    end
% `- G/ a8 Z/ J# N  oend
; Q$ D& k2 }( ?, w: |8 k+ X7 Z' M' ]1 {" H  O
begin P_pick3 arriving
: o8 S1 W8 D1 i6 P( r    set A_i to 21- |1 N# o) \# r$ U: ^1 _/ ?# b: ~
    move into Q_induct3
; Z: F7 h  P; z* L3 V- H5 K4 W* Y    move into pickaisle.induct3& Y& ^7 |0 S( A  U; {
    while A_i<=30 do begin8 r" y# a6 g; j( L# K
        travel to pickaisle.con(A_i)
9 Z0 ], z' R' P2 N( o1 T! c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) W" k2 t$ w9 O& e- Y, J( B1 E& o
        else wait for 10 sec
& ~7 P; j8 {' @- w7 M        if A_i=A_leave then send to die
/ P, C* d) }( N        else inc A_i by 1
2 h/ g; ~9 M5 N    end& U# M" @/ Y# t. x
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是个什么东东?
9 I( e: L' g# \! w' `move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& x" X) ~/ Z! W, Y- G/ x

2 U; _5 a6 i* }6 P) N3 x9 nAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. m: G  m8 @1 [/ Q( g" |

/ n( w# p0 Y$ z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  q, ^/ x% V; z5 @1 g& Q( x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" s. w( N2 v- H" v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;( [7 i$ V$ l: J8 C9 P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' W3 ?+ d+ J: G+ t; k8 u. I( Ubegin P_induction arriving) |% a9 J# I) D4 j  c( V
    clone 1 load to P_pick(A_induct)
+ x# j1 R5 c2 u7 x7 P; Zend最大的系
+ i! R: h% \5 V% S+ z6 o0 R, \' ?$ P. C4 N" {* w
begin P_pick arriving
9 u  B8 e& }  l' f! P$ m& k    set A_i to procindex * 10 + 1
0 i* D: ]0 n1 L5 T, y    move into Q_induct(procindex)6 E6 v% ?; e  U% ?* @
    move into pickaisle.induct(procindex)2 p  o* @3 [3 h+ p
    /*check the type of pickaisle.induct(i), for your last problem.*/- x7 m! d! f) Z! w- Q
8 d! x7 p% y: c# l* u$ T
    while A_i<=30 do begin
7 r9 [0 K. @# U5 W( R4 w        travel to pickaisle.con(A_i)8 N9 H9 O2 {, {  l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 @4 s! k" l1 g# ], c
        else wait for 10 sec
" t. }" _3 x1 M% J5 U- W# l, J- r% {        if A_i=A_leave then send to die, g4 [# u* ]0 |2 m" O- ]
        else inc A_i by 1; Z+ M4 X  V7 l+ ~3 ^' S, R8 R
    end
( s" F2 ], g$ ]end
+ r7 Q  m/ d: [
  [+ B$ i8 A$ [3 l8 w其中的procindex为整形,代表当前process的序号。5 U' R  p! z1 |0 ?+ ~% H
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-6 05:48 , Processed in 0.019381 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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