设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15108|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' a8 q; R( ~2 ]3 v" G7 U
. B. ?8 ?5 t: L# N1 u
我的问题是,在每个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 P# Z9 _2 y6 h, A0 c: H

7 C$ u( }1 T; Pbegin P_read arriving
) [' j  I+ n3 N1 O  Q. p+ i: G    while 1=1 do begin; O3 G5 G, `$ V. ?. [
        read A_tote from "data.txt" with delimiter "\n"
! d7 e) s9 ^8 G0 r1 Q        read A_time from "data.txt" with delimiter "\n"
  x' ?/ t, ~$ K* S8 i8 m        read A_leave from "data.txt" with delimiter "\n"
+ A. K4 [- E3 y2 d8 w% f        read A_picks from "data.txt" with delimiter "\n"" H5 [% Q( u- d: B7 Z8 L# H$ O0 n
        set load type to A_tote
1 e( o# B# b9 {$ v. X" V( q        if A_tote="tote 1" then set A_induct to 1- S) P' H+ d2 y6 s
        else if A_tote="tote 2" then set A_induct to 29 ?0 L9 \' X! V; v
            else set A_induct to 3    ) ?) j* O3 \3 q
        set A_i to 0
- o# H: b  x2 k3 ]        clone 1 load to P_induction
. G3 m: X/ n' a0 @# j) n% s  m        wait for A_time sec
9 S. w" K& T+ M  Y; O8 c    end
* ~9 b; D- e3 U- v, J, d! X2 [end  U+ f5 l: B0 M# ]
! h% h# m; [+ q. _4 @. h; p
begin P_induction arriving" K2 x6 C, L  Y1 i
    if A_induct=1 then clone 1 load to P_pick1
0 x3 N/ s# I4 K    else if A_induct=2 then clone 1 load to P_pick2
% O; O! v5 |9 G- L9 T        else clone 1 load to P_pick3
" S- B. L* V2 j! j1 Z4 {end
, b/ r  v; Z6 C1 }$ ?2 E; `7 @1 _0 N  P: _, v/ Z% X
begin P_pick1 arriving/ z' D* B  Q0 e: w
    set A_i to 1& w3 I, Z) G* t/ \$ P' h; n
    move into Q_induct1# V5 b) d+ l, |% f: v
    move into pickaisle.induct1
  ~3 t: t9 w: D( @, W    while A_i<=30 do begin
. H) `$ e3 m# u% G        travel to pickaisle.con(A_i)
' R7 v, w! b  C- I  ~9 r2 i; W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- [# }- n' b' D) }/ }2 R
        else wait for 10 sec  I  C! i& d. Y8 _9 F
        if A_i=A_leave then send to die! X0 |% }- N+ p- n
        else inc A_i by 11 J0 W1 Y7 n( ]; U# F+ D
    end
$ `1 e8 J7 n. Z3 W! `" q/ V* L8 \end
/ n9 h4 `$ X' m, Q9 V
( z- V9 E4 }( w! A4 jbegin P_pick2 arriving
2 g' d- G( H! w# h# M7 c* d5 }    set A_i to 11' I1 X* Z# z8 K9 _6 J* K4 I
    move into Q_induct2- t+ w: m3 y3 ^: S4 l; h2 q
    move into pickaisle.induct21 f$ \$ h% T, j3 I1 O+ R
    while A_i<=30 do begin% C. j# D3 w+ G3 B4 V6 R
        travel to pickaisle.con(A_i); j' g$ Y9 A4 W0 {+ ~% e' W! ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 G, S+ s( l( g! q        else wait for 10 sec2 b4 I. }/ `, |9 [
        if A_i=A_leave then send to die
& Q" T4 D# E! X- }  ^0 b$ n        else inc A_i by 1$ r) ^3 V4 D" s; Y
    end
6 O' `& r9 L1 M! k; K- k  Wend
5 b% V& ?" N1 k0 {. o) A# P/ A8 h$ Z8 N9 a
begin P_pick3 arriving; u2 j3 n6 s. |+ F* }8 \
    set A_i to 21* q8 [4 q' R9 }
    move into Q_induct3
: h" g6 @3 M3 s4 G% z    move into pickaisle.induct3
+ S( |6 G# y5 g6 J9 T    while A_i<=30 do begin9 u4 u6 \4 W9 Y8 q9 F
        travel to pickaisle.con(A_i)- X1 L8 u2 d+ S# D1 s3 K7 N. r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, k9 U6 a, f- e! f6 o
        else wait for 10 sec8 n" y. C. ^8 s7 m0 r
        if A_i=A_leave then send to die" v1 p5 k+ p, X8 ?# C8 j
        else inc A_i by 1$ @! A$ V: A2 K) i
    end& C# ?5 R; ~6 G: j
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是个什么东东?5 Z# J" _; G) `7 m$ l3 f5 K# Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ ]5 \: L5 i* E' ^3 A/ A8 f9 s4 P% p# D5 k
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) c4 B5 V6 g+ N1 |7 @# R5 p1 \4 e/ z+ H& P) ?+ G6 h, l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ K# \! a! ^) m6 k. C. w, H" d* p1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  G) b* x( s! x8 x" q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% g% @% \1 J8 z" C" T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( L3 W7 n7 o- Wbegin P_induction arriving) k" {0 j. `  r( \; B7 V" o
    clone 1 load to P_pick(A_induct)8 }! ?! n; }! u! v3 S, ]& U  @; U
end最大的系# d% w" B$ X, V" o2 h: s5 y3 C
; M0 |0 o  c6 F( h* }
begin P_pick arriving$ r9 V" v* M* N9 Z1 i/ l
    set A_i to procindex * 10 + 11 a9 ~5 X, U/ W# S4 @: d; b6 g
    move into Q_induct(procindex)
: ?; U- B, u& H8 R3 _. E$ n    move into pickaisle.induct(procindex)
  f: D2 F+ b1 S* _. U6 @  I/ B    /*check the type of pickaisle.induct(i), for your last problem.*/2 i! }; v. T$ U; s, \& c
; L: e  k) A: b& E6 }; m
    while A_i<=30 do begin6 ]5 Z) y5 j0 t/ f/ R+ R
        travel to pickaisle.con(A_i)
- p4 O, |# [4 U8 [( }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) X. g3 ~0 H8 O  n! f# {" D
        else wait for 10 sec6 J; ~6 m& v& @1 U- d! }' B
        if A_i=A_leave then send to die
& h# f* E9 \; j3 d; ?: a        else inc A_i by 12 ]5 D; M" a! }+ k! x1 _3 }
    end
0 k9 |% a3 v  P; aend- ^5 c' L2 I5 Z4 g) K+ i0 f  e

% e8 C! z" Z& S/ e# z其中的procindex为整形,代表当前process的序号。
5 A2 |& W. S2 C# K! astation和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-11 06:27 , Processed in 0.045400 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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