设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15069|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ e# R5 u8 O$ W, {" ~6 \" t# w
- D* i. P5 o5 F! P  i# L# 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中的数值,不知道会不会有什么不妥。
! e8 u+ l& \& s# s5 T- K' q; t! p
8 n& P7 g! h$ }  F6 b; @/ ?+ gbegin P_read arriving! {% ?- G5 o, B8 U8 l% X: D! K
    while 1=1 do begin. P: w) }/ e% i& |/ n
        read A_tote from "data.txt" with delimiter "\n"
% Q, d' S2 f) [' F7 |        read A_time from "data.txt" with delimiter "\n"
/ u" P% u) G' Z" [        read A_leave from "data.txt" with delimiter "\n", n; Z/ U  s  A( p7 F
        read A_picks from "data.txt" with delimiter "\n"
4 G/ c$ d' H/ N1 y4 `7 i8 x5 P        set load type to A_tote
. g2 B, {) d' w& C- x: W& P        if A_tote="tote 1" then set A_induct to 1+ G3 A; X2 m3 h8 g
        else if A_tote="tote 2" then set A_induct to 2
  j4 h' N0 M2 T$ \& d6 Y! w            else set A_induct to 3   
0 d7 C4 i5 d3 F5 I- F' u6 m3 ?        set A_i to 0
* Z* \2 r2 w. \1 g4 G        clone 1 load to P_induction
' K- m6 B- P" F$ @! K        wait for A_time sec2 e* s/ ~8 i0 o2 z
    end
6 W- X7 b/ A) |7 Pend$ r6 |" D) l* P* A6 j6 e

' `. v# J: w, x! Sbegin P_induction arriving
$ W" F1 d. n1 _# \9 z7 ]: o* N    if A_induct=1 then clone 1 load to P_pick14 A# ^# d7 W! S& y( n5 I5 s; f
    else if A_induct=2 then clone 1 load to P_pick26 n/ f1 ], K$ Z+ S" [) }
        else clone 1 load to P_pick3
! {* g9 C  B+ T7 B# c- ^; cend) G/ E9 c3 T/ l- A" H
. k# X. q/ ]/ R9 N
begin P_pick1 arriving- O8 u6 d. y$ i
    set A_i to 1
1 N5 Q1 k' D" O3 W4 F    move into Q_induct1
  n1 Z0 C  z% w    move into pickaisle.induct1
+ z2 w3 |! c0 k0 p2 N7 h9 w9 ^3 p    while A_i<=30 do begin
( m8 u5 ~3 }# V+ T        travel to pickaisle.con(A_i)
8 \# F. Q: V5 E5 y' Z5 |& v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ]8 q$ d; z' o0 D4 B        else wait for 10 sec
: z4 F" @8 [6 ?; F        if A_i=A_leave then send to die
  Q3 e2 _* N  W  f' [- L) t7 K        else inc A_i by 1
4 N; a, T; P& o+ w0 T6 m; y" J: G: M    end
0 T( U& a3 k/ t( ?end
# \5 }3 x) [2 a, K# @' w
, _, j7 Q& h( Z6 `begin P_pick2 arriving
2 Y6 G9 V( K8 S: w0 ]    set A_i to 11; Q5 h" D9 C1 R! p1 I0 D8 [
    move into Q_induct2
1 b5 P. _5 v4 p/ K    move into pickaisle.induct2
, M# o0 U. W+ I, I" R5 e    while A_i<=30 do begin
/ d, Y3 L5 ^' i        travel to pickaisle.con(A_i)* a: A; F' c% H: F" N) C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% p0 c- x+ ]8 [3 f        else wait for 10 sec
4 O8 w" x, l0 u/ T% C3 C        if A_i=A_leave then send to die; u# N, F5 w/ c! o! F/ ?9 v7 g
        else inc A_i by 1' f0 Z- e1 y$ _1 }0 J7 t
    end/ t2 J# v6 D( [6 f$ N5 v* F$ _
end
3 X% O1 H& _4 a
4 v9 i& ]- [% {4 R& q5 xbegin P_pick3 arriving
( _1 B1 R! R: o' _    set A_i to 21
/ f. G! c; z9 l9 g    move into Q_induct3( R/ T! o, O' r( W1 z
    move into pickaisle.induct3' z2 R: c7 R. C7 g& }! H2 a' j
    while A_i<=30 do begin0 |9 ^! {6 T" A; Z
        travel to pickaisle.con(A_i). e# d  p! Y- ]% X0 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: s* J' Y3 }" n  k# L, _
        else wait for 10 sec' ?- j: I) O5 M1 ~
        if A_i=A_leave then send to die
# w! a1 E! Z7 v  b; X% ^( c& f        else inc A_i by 12 M# y9 T7 ~/ {: l
    end
0 o/ s! g: m% k  |3 Tend

最佳答案

查看完整内容

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 o5 a, J0 N# N% l+ `move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- i7 K* T7 ~! f# P+ @1 j: B4 O. c! o* ?: M; B+ }) c
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! B9 D0 O% b$ J  e1 l" \$ Z* A4 i; ^3 |
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 o3 F0 f* d& S0 G3 b/ x3 b
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& T9 N) d! {& o% M3 P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. L1 v# L% w/ n: u8 w% C9 Y6 }' w3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 g$ m" Y* b. r2 U* _% t
begin P_induction arriving
. M/ m; O: h* [" N0 w1 a- l% z    clone 1 load to P_pick(A_induct)$ F2 @; z9 C7 E1 ~; s! z
end最大的系
' c' o, T) {# o5 t, T! p+ `7 T2 z( u" k' T
begin P_pick arriving
$ v1 ~- h3 `- ^# Z$ r, z3 c    set A_i to procindex * 10 + 1
7 J3 h9 M0 V; R3 F' l3 {    move into Q_induct(procindex)
. H# h) h0 t6 V% q( n4 g4 y0 k    move into pickaisle.induct(procindex)7 q2 m0 F$ ?1 y: J* A
    /*check the type of pickaisle.induct(i), for your last problem.*/8 m& L6 T% q& y( Z  y6 _

7 Y$ ?' S3 z, ^  X. c    while A_i<=30 do begin
$ t; `8 K* U* c6 u" {        travel to pickaisle.con(A_i)
( }9 p0 n# u5 k8 p1 e4 r" n0 l& o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 ]' m9 f$ |1 h0 V
        else wait for 10 sec) `/ o+ t5 N% r6 s
        if A_i=A_leave then send to die& O( b. w; V) @. a
        else inc A_i by 1
( K' J# h$ V& j8 |    end
; V* ^! z9 [; v3 A# ^* iend
& B) y' h5 j; p2 r3 d0 B" V
" W- ~$ ?7 X$ r其中的procindex为整形,代表当前process的序号。
/ z  J( ^9 D8 [! H" Kstation和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-7 16:35 , Processed in 0.021659 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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