设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12510|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# {5 e1 Z% e7 [+ z6 P" }6 \9 r" R* {8 Q) m% H9 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" i, f( ^0 O2 N
6 s: h, t8 q( N+ r$ i) Ebegin P_read arriving! y# f0 i6 j/ i. Q0 x& ]
    while 1=1 do begin$ K$ w9 D/ e# S! G( x! v6 e
        read A_tote from "data.txt" with delimiter "\n"- a; a- q+ O! N! z5 L
        read A_time from "data.txt" with delimiter "\n"$ P  j1 o6 Z0 b  S) O& |! l3 S
        read A_leave from "data.txt" with delimiter "\n"
; \8 x* a9 X) L  h+ A! O6 a8 B        read A_picks from "data.txt" with delimiter "\n"
0 C/ h  r& D/ c1 M# q, Q" g' I" I        set load type to A_tote
2 a, y% b" d. M! r4 E        if A_tote="tote 1" then set A_induct to 1
4 E' @/ Z* m3 a- N9 d        else if A_tote="tote 2" then set A_induct to 26 V7 H) m& Z( L2 H6 X
            else set A_induct to 3   
( b; x; C8 j7 |. A# M4 ?' F        set A_i to 0+ S1 B% A' C) f, Y
        clone 1 load to P_induction
' p" J4 b" k( C: n        wait for A_time sec# Q2 e, j: d. b
    end
3 v3 C! V5 F  t  Iend8 t  i# Z' W$ Q( J* ^

( C  y- z; ?4 T! [  Rbegin P_induction arriving
) R. v( Q$ }5 C    if A_induct=1 then clone 1 load to P_pick1$ `& X- H. j7 t* U4 S: [
    else if A_induct=2 then clone 1 load to P_pick2
1 `& M1 w! {2 U. Z4 |: \9 ]1 @        else clone 1 load to P_pick3
$ i2 `; j8 @: y. f- Q- ?# Iend
/ Q7 J7 N! H3 Y; L  S4 d
( ?8 N# b$ I. g5 m. Y1 x) Jbegin P_pick1 arriving
" ]* G8 N; O- t    set A_i to 16 O. Y- k, Y  K; z; C0 b: C
    move into Q_induct1
# K8 R3 j0 p1 }    move into pickaisle.induct1
# Y& A' \$ p5 X    while A_i<=30 do begin. X' S8 e2 O( k5 N/ O  x: R8 `6 x
        travel to pickaisle.con(A_i)
5 h5 i  |, c3 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 {0 z% z% ?% i7 {# c  v4 j
        else wait for 10 sec6 x+ h% ^6 h7 y8 L8 z; @: o
        if A_i=A_leave then send to die* n3 w; T1 W' A/ J# z
        else inc A_i by 1
, H5 V6 Z2 E- x7 U, K: V8 i    end
% u9 c+ ~  O# K$ d/ ^0 Aend
8 h+ F+ P: f) w7 G, u, }) a, n5 |# B- E
begin P_pick2 arriving- A- x# u. T" p  S* H
    set A_i to 11
3 x$ [" E2 O% f/ ?: z' U    move into Q_induct2/ [/ P& v) x# I1 G
    move into pickaisle.induct21 Z) M1 e9 G+ I3 C/ g1 y1 r: P
    while A_i<=30 do begin' s- Y- Y# x$ e+ v1 R7 n
        travel to pickaisle.con(A_i)! }, w+ }2 A; N& v9 Z6 T6 s9 Q8 s6 A  K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  i6 \7 Q* c& n4 D) f! n        else wait for 10 sec
4 }4 T3 E/ Q5 p. x  I$ d        if A_i=A_leave then send to die
  l8 W4 F3 X6 z        else inc A_i by 1- d& j! Y4 T& C  l5 G- s$ b, O
    end0 [# }" G8 Y" E" ?
end0 a% X1 N# U1 R2 F( _6 w

2 G: [2 {6 R* p4 t, @% R& Gbegin P_pick3 arriving4 D6 n% z4 N- D' G! K( J
    set A_i to 21" P+ R0 S  ~7 X9 S; x
    move into Q_induct3
4 E/ r. A& A; ]    move into pickaisle.induct3
0 F: g$ @' w% |1 w% h1 v4 {2 K- i, Z    while A_i<=30 do begin" t' y% ~$ J- _5 f) m
        travel to pickaisle.con(A_i)( o4 i% Q6 `4 X2 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ D, a( ~* o: b6 U8 _/ i        else wait for 10 sec
1 p$ ]# l2 ]/ y* R6 X" `; O        if A_i=A_leave then send to die
3 }$ h+ c% K# i* Z        else inc A_i by 1
  E; F- s8 K: p- ^9 G# ]    end! {; \$ c( F" _0 @8 G; R
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" f% }+ y  _- ^
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' a) b- {# f8 r- f" X" }
, R* a6 d# b. ]) l
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; b9 ~# A6 M1 ?2 i7 x6 d+ ]
& [+ ]* M5 V5 S  d3 M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( ]: p1 z, U* C1 r. i1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% M0 T# q3 L  h2 ]. Z' r2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 O0 s# L' j8 N) w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ [. ]9 J" \) n  a7 J, kbegin P_induction arriving
( s/ t: X7 Q* E" @9 K    clone 1 load to P_pick(A_induct)
7 Z  P+ q( g  \2 p0 }/ n- A: t1 }end最大的系
# z; k5 F; Q2 O6 [! X8 O' H
% q2 ]* _2 y% y% d$ V/ ~begin P_pick arriving
6 l; `/ I( E; h$ B! u    set A_i to procindex * 10 + 1
- x- ~1 Q/ {- X0 v% V    move into Q_induct(procindex)
# r# @5 [! l* a1 X. P    move into pickaisle.induct(procindex)
. r" \4 E  B7 H! }    /*check the type of pickaisle.induct(i), for your last problem.*/% U- f& Z9 L5 t- \6 U
! w5 U$ V. H+ l" z. }8 }* C
    while A_i<=30 do begin
" |8 ~& ?- Q9 s: u        travel to pickaisle.con(A_i)7 m; p" O9 T1 z8 O3 A3 g$ n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 g$ B: c1 k2 R# ^" m: {* m) k
        else wait for 10 sec
/ I& D8 K6 n4 e/ ^. w        if A_i=A_leave then send to die: {5 H" C. }6 I! e/ @) z
        else inc A_i by 1
' D6 G4 \9 z, Z- D' b9 g    end
7 G. u1 L* x+ K, u( xend! r  s- X- f) y) x

& |  F$ s, z% _+ k) _; L其中的procindex为整形,代表当前process的序号。! J/ {1 p% i& l4 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-1-29 11:12 , Processed in 0.015470 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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