设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13498|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' e/ w$ Y! F$ T; r) {# t; w4 j
- r, N7 x( w; T9 Z6 w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. V1 j% h3 d: J/ T1 T5 r4 k
. N+ P1 @" [/ e) W" U" z7 I" a2 O7 G
begin P_read arriving
; `  P4 M* h0 \& v2 M    while 1=1 do begin
# k' q. {* a5 [4 y        read A_tote from "data.txt" with delimiter "\n"
0 V. l9 i- S7 p, c6 l: s5 Q2 `        read A_time from "data.txt" with delimiter "\n"
( p3 r* s7 s0 X0 r        read A_leave from "data.txt" with delimiter "\n"
1 F3 P; I9 _3 W. Z: q7 F1 T        read A_picks from "data.txt" with delimiter "\n"2 f: Y( [0 l* Y# v/ q& R
        set load type to A_tote1 f: F- t2 G0 C* p* y0 |5 e8 i8 C* m
        if A_tote="tote 1" then set A_induct to 1% F, q, ?/ v6 d
        else if A_tote="tote 2" then set A_induct to 2" \" a- x& }# Y" \
            else set A_induct to 3   
  ~* N. G0 [4 ~7 @        set A_i to 0
0 ]( G8 F6 K0 e6 o8 B5 q; a# `        clone 1 load to P_induction9 y6 s% m( @( `
        wait for A_time sec- ]+ ?/ b# t" G9 Z9 i
    end
9 C# }$ I4 x! n: t" V- x: Lend3 W% Y& s8 Z, E- B9 ]; O9 H
& X  r2 g$ K" \5 }: z4 R- ]  p
begin P_induction arriving
/ ]( r6 A1 j7 ~3 J% j* e" m    if A_induct=1 then clone 1 load to P_pick1; G/ S$ b  M9 i8 `/ X$ \, m* o
    else if A_induct=2 then clone 1 load to P_pick2
* g! G7 m3 \4 z/ C; A$ d        else clone 1 load to P_pick36 Z" B: l9 X  ^3 |( v8 ^" ~
end3 [7 N" m6 ]$ Y- ^9 W+ ?# I( _
8 _3 m& u0 @" E. D9 |/ T) ^
begin P_pick1 arriving
* S" A* G8 w1 t( u: q' ~, T    set A_i to 1
2 }* y2 {8 f( v' I. E    move into Q_induct17 {& ?- K0 w% G* s
    move into pickaisle.induct1
5 d2 Z' ]1 @. l( Y5 d8 Z, v    while A_i<=30 do begin5 D* ~6 }  P/ }( L
        travel to pickaisle.con(A_i)4 c7 ^7 |$ ?. ]+ g- N1 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' U- b, L$ G- w- b8 T        else wait for 10 sec
0 m# e2 ?0 r5 E- u! w        if A_i=A_leave then send to die: L3 Z8 T+ M8 o! ~: L' e: b/ Z# |
        else inc A_i by 14 d6 @" Q- x) P3 x
    end/ [: ]7 x! s( {2 ^7 G! h& ]; d
end
( C# Q/ o5 I$ ?7 f  [6 V* D+ |6 V" N) w5 p3 z. V
begin P_pick2 arriving
6 S% n7 N. z; p0 M. f    set A_i to 11
6 q( Z9 k/ N* W- X1 o7 N! {    move into Q_induct2* U0 r1 [- Q/ ?6 c$ L/ q) l  b% l
    move into pickaisle.induct2: q. D1 F. @( t  {
    while A_i<=30 do begin- V3 E0 B$ B: L: _7 [
        travel to pickaisle.con(A_i)
+ Z6 ^* F/ x% P) _5 {8 l& h. V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( A; r* K6 ]/ o3 N        else wait for 10 sec
8 r. }) O: i1 \! g( |        if A_i=A_leave then send to die: u# `& h$ B6 J5 `  S/ s
        else inc A_i by 1
( L& W. `- W  c3 K, y  M9 i    end7 v2 I; {9 p1 J, C8 v- ~
end, R  l  c1 B' R! x
2 \/ p6 U# N& V% V5 Y% b4 o. z- L, M
begin P_pick3 arriving
4 |! i& L8 f6 e" K* _2 h1 ]5 G    set A_i to 21
# x# W9 p) Q4 A2 Y/ f# Z( @    move into Q_induct3! y7 ?& {$ G3 L* y
    move into pickaisle.induct3& {) O1 b6 O6 U1 r8 S6 L2 X
    while A_i<=30 do begin% \: U. y$ M+ o- O' E& B
        travel to pickaisle.con(A_i)
/ m. n" v8 s8 M+ b$ a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Q5 P1 `) }4 E
        else wait for 10 sec( g1 j8 A+ V) K2 C$ s
        if A_i=A_leave then send to die
) U0 n8 M! J6 w+ `" F        else inc A_i by 1
  a' ]3 \) m0 w( I3 \0 V3 T0 Z    end
4 m  B& C9 D# A" X: T( C: T( vend

最佳答案

查看完整内容

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是个什么东东?
  N: p8 f$ D. J5 }3 u* t* Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. N9 G3 a1 Y# _% k& T% |; a* Q5 P) O3 O. G, j% A* h5 n( [. A# k+ `0 D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ \1 ^# I1 A3 m6 t. K/ I! ?
$ n$ b* v. G, {( W# z6 V7 A
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 }, c/ W- @0 n0 Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ N% g+ N! C) u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 H& q% \0 X/ t$ U' t/ {4 T
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: Q) `" S) n: kbegin P_induction arriving
+ a" Y: q( z! a" o# V    clone 1 load to P_pick(A_induct)
' |% I( L  R' ?/ yend最大的系
7 l4 M, k; d" C/ ^- }3 g
+ Y, I$ `6 A& hbegin P_pick arriving
! I7 E1 R$ w5 y1 y2 e, o    set A_i to procindex * 10 + 1
* E1 [! J0 ^" l6 S* g- Q    move into Q_induct(procindex)
: o+ S, @9 N" l+ B$ s    move into pickaisle.induct(procindex); k" r0 E! M$ d) d5 t3 U
    /*check the type of pickaisle.induct(i), for your last problem.*/& Y7 v3 ?3 m5 m/ ?5 |

1 }. i9 o4 e- p' V    while A_i<=30 do begin
5 G+ R7 l" g8 i1 v+ r1 o        travel to pickaisle.con(A_i)
+ Z/ c1 _1 m) ?" O7 X5 k5 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* x0 y+ i; i( Q2 w- O: K: b# F        else wait for 10 sec4 H% w( r, E2 y
        if A_i=A_leave then send to die0 U, [( U+ M9 q* I4 o
        else inc A_i by 1- Y! \- K4 L1 {" y" {
    end
. q, k; s& N$ p% t2 l' |, P0 cend  ]1 A6 o' W8 X+ u4 q
; ?. ~5 N. b. ?$ k( E1 ?- u% ^
其中的procindex为整形,代表当前process的序号。
1 c$ ]8 O4 U2 c# U+ a* E: r2 _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-17 21:14 , Processed in 0.025316 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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