设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15184|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' a  @5 c8 o% D/ b, K2 O

( V' V" J: @8 d4 S, o; _我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 C; v4 _6 h, Q4 I( A6 D% i0 s: T
begin P_read arriving
1 F6 W. b$ g/ w4 s+ L- p    while 1=1 do begin, Z( l5 H* E' B. _: q% f
        read A_tote from "data.txt" with delimiter "\n"
4 @: a: r: a, y& w: z$ p6 ]        read A_time from "data.txt" with delimiter "\n"
, w$ L3 F$ L7 I( o* J( T        read A_leave from "data.txt" with delimiter "\n"
' K8 `- G4 g+ \: d        read A_picks from "data.txt" with delimiter "\n"
  {1 V4 v; Q* B8 b' N( p1 `# h7 g0 H        set load type to A_tote
! w% j& T$ d9 Q8 n- j        if A_tote="tote 1" then set A_induct to 1% L$ l/ [6 Q7 O& @6 K
        else if A_tote="tote 2" then set A_induct to 2! e, s5 l; r. S9 j2 T8 d. X$ P
            else set A_induct to 3    " `) J9 B& K( I, N* v
        set A_i to 01 w# B+ b2 M+ p$ ^
        clone 1 load to P_induction
* f0 J+ v& L2 Y' c        wait for A_time sec
/ A3 y: U+ s1 ~( m( ~    end
3 B0 m# k3 B/ y9 b( P8 pend
' o4 x/ b- |* h, b8 R* z: Z7 l
( l% O# [3 f7 P3 ^* ?* L% nbegin P_induction arriving9 m0 k0 Q7 }  o- v
    if A_induct=1 then clone 1 load to P_pick1
- x; z! P3 S% ]" O  {# i$ ~9 j    else if A_induct=2 then clone 1 load to P_pick2
  K6 f& ^9 a; h% [, q, w        else clone 1 load to P_pick3% r0 f$ ~( C2 w- v1 D
end9 k. J+ ^8 D2 N$ W
% ]1 @3 N; Q# q1 C2 K
begin P_pick1 arriving
8 j7 J+ o, X& C4 y" _1 k# S    set A_i to 1$ s  m7 C! m) I1 ~: s3 t  J7 C! T  l
    move into Q_induct1' o( O  `2 _% b% J+ L* b
    move into pickaisle.induct1
! f( [( H3 p$ L3 h# S    while A_i<=30 do begin) A8 s* X+ y' {1 X
        travel to pickaisle.con(A_i)0 U  n8 j  }0 v9 z8 E  x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 {6 j4 f4 n! P        else wait for 10 sec" y; E4 ^9 h' ~9 v  H+ X( \) W
        if A_i=A_leave then send to die
3 b4 h+ e3 [; N2 K  ]        else inc A_i by 18 d, u! r; [) r
    end
6 a( U2 P, o6 _6 U0 k2 Cend
" Q! q$ ]1 X) E6 {6 \
' \2 K& M, \6 I' kbegin P_pick2 arriving
; W) o6 Z4 A# @7 W3 V. h    set A_i to 11
6 \6 [8 q9 J$ w! @3 X    move into Q_induct2
" T1 y$ K( l, ^, H) u    move into pickaisle.induct2
7 ^5 W5 c  G- P6 U    while A_i<=30 do begin3 M& X/ c% G) x: f1 l3 S
        travel to pickaisle.con(A_i)
' U* q9 b9 V$ M1 W! w7 L# `( W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% @3 J! T% F2 W: H/ K2 S        else wait for 10 sec
: E; {# W. N; W        if A_i=A_leave then send to die6 o* p8 W7 d7 V9 r; x, d
        else inc A_i by 1) K+ c( Z) P: \4 C0 t8 b! d
    end
- R$ K1 \& t* t" O0 eend
/ W  U7 h8 y+ m. q# x) r, j/ w4 e* }2 i0 |7 V, O
begin P_pick3 arriving) L- V  e; C& v+ `: x  [8 \9 w
    set A_i to 21
9 N) W4 ~  N$ p. {0 j" V8 U    move into Q_induct35 S& _: z. c* J+ I' `2 a( h8 u
    move into pickaisle.induct3
: S5 J' w0 d8 w8 [    while A_i<=30 do begin
3 D4 C" G4 q* _8 |% {! L# H        travel to pickaisle.con(A_i)
0 p! j' z* E& g+ m1 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 {( G9 Y/ M& [# a5 B. @
        else wait for 10 sec* v1 P" V/ Z0 A/ \* l4 Q
        if A_i=A_leave then send to die/ @3 t9 O, \% b9 p7 u
        else inc A_i by 1
: |; e% s; p  c/ K1 u, `1 x    end$ A) m8 U) H' }
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是个什么东东?
0 y; i4 z2 K$ [3 I+ p: r9 M- umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 e7 S! ]& P( g

( I8 f" h7 W! S/ uAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 @7 e2 C, v1 G6 I, F
2 _; R: J6 \* }8 z4 u2 K6 a- @
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:* s1 m( d! V0 R9 D0 }4 q7 s# Q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 _6 n: i. ^2 @; k" |3 N5 f4 ]- u: g7 y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& m" W. n; V9 g& R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. T% p, Y) K$ I" k* e+ T2 I1 Fbegin P_induction arriving: g8 d& ~5 f0 \7 f2 L! E9 z
    clone 1 load to P_pick(A_induct)
, V2 }, \3 E8 h2 l9 U0 U7 Aend最大的系0 F0 N  u1 b9 i" i: c. m
3 J/ {& _3 A& T
begin P_pick arriving" g% G- p3 ]) v# P
    set A_i to procindex * 10 + 1
- W! g7 I/ P$ \% x1 N3 i) c    move into Q_induct(procindex)
3 l# h2 w& ]0 S7 M; u$ E    move into pickaisle.induct(procindex)
) c) n" Q- ^" @, U    /*check the type of pickaisle.induct(i), for your last problem.*/
" b4 p+ ^. I! V  r) n4 J' w, I8 v) _9 s9 |9 ~
    while A_i<=30 do begin
2 r/ c* z: c8 W3 ?8 U1 Q        travel to pickaisle.con(A_i)
$ x4 F* ~  B" e; L' N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- B0 Z7 q6 k1 }" E; q9 u7 J        else wait for 10 sec, B$ U3 d& M5 v! y% d' n, ^. f1 Y7 I
        if A_i=A_leave then send to die
& C- U' m2 _3 _3 X9 j* z        else inc A_i by 14 o$ k! b! T: h* ]5 O
    end6 o. n; y9 H6 C* `2 d% `
end
8 F/ y6 {3 D' i1 o$ H: A- J! Z; @' \7 k  |8 q( E% e% d0 [% ^0 x' v
其中的procindex为整形,代表当前process的序号。
5 c  o3 @; f9 bstation和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-8-20 22:05 , Processed in 0.019146 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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