设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12696|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 c: x- C/ a) ]( T% f* s
, D; ?( j' F/ A7 y6 V' R. |1 E我的问题是,在每个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中的数值,不知道会不会有什么不妥。) P# j3 H. g. K. V1 n  W+ W" r
4 I8 u+ b& y! x. T- `, `4 R
begin P_read arriving# z5 K  K/ I* v( ]1 e0 v) m
    while 1=1 do begin
0 o# P0 o4 k$ `8 t5 D9 q        read A_tote from "data.txt" with delimiter "\n"1 g) [0 e/ F. ~, I2 `7 ?# Z! R
        read A_time from "data.txt" with delimiter "\n"
+ k& @! {  f8 N# N- b        read A_leave from "data.txt" with delimiter "\n"
9 I, Q' [# x% A" t6 y        read A_picks from "data.txt" with delimiter "\n"/ g( T- v$ t. R1 }) b4 I
        set load type to A_tote
# \) Q6 m! G& B$ R. B3 ?        if A_tote="tote 1" then set A_induct to 1" z. f- |- y$ s# l
        else if A_tote="tote 2" then set A_induct to 2# X0 j5 O: V3 P% o! T% t2 W
            else set A_induct to 3   
1 d' \  \# X" x9 C. X* I8 a+ s        set A_i to 0. R( W% U2 t4 s' A- B
        clone 1 load to P_induction+ `9 ]& I7 v4 l; B+ M* E' i) D% i& q
        wait for A_time sec4 B/ p  L) O& f: I! s6 s2 ^
    end5 Z: i3 E, A7 Z3 U/ a2 W5 n
end
( g& @1 `! ]+ t* j7 [$ ^# b. ^
( _' S& L6 M! }5 Xbegin P_induction arriving/ ~  ~$ y4 n& X; r* w
    if A_induct=1 then clone 1 load to P_pick1
& h4 a' H( [. L6 f: A% ?7 \    else if A_induct=2 then clone 1 load to P_pick2  A0 B/ i7 n6 _' ?, ^
        else clone 1 load to P_pick3
/ y% L9 S( P" Y$ ?2 xend7 ~+ w# x; |5 h) }- l& W5 o$ G
( P8 y. F% J# V" r3 U, k* ]
begin P_pick1 arriving0 k. s3 B3 Q4 z, @
    set A_i to 1
$ o9 B$ u2 F3 I. I; |    move into Q_induct15 a, q0 Q3 M4 C5 J
    move into pickaisle.induct1/ c8 g: k) ~9 `
    while A_i<=30 do begin
* m- K! B9 P1 j2 p        travel to pickaisle.con(A_i)
; ]: E, h4 w* Z+ \1 h, ?/ B' o$ E4 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& Y: ]. c6 q5 ]1 d( L/ M5 \% \* s+ y! `
        else wait for 10 sec
. d1 g0 ]: ~& c: ^6 d        if A_i=A_leave then send to die
: Z$ ^0 m5 v; I1 }        else inc A_i by 1# U% J8 B- U8 S) ~# Y- R
    end
. Q$ K9 \9 j' H  v- X/ S+ X! iend+ d( O2 s3 d# [  D4 z, d

( l6 y" `$ s: E( s' Pbegin P_pick2 arriving
% h, F. I$ q) d" v7 I. r    set A_i to 119 P& ?7 [- k3 w- h4 \5 b/ c5 i8 M9 u
    move into Q_induct2
8 d7 X% z) n1 t* N5 R    move into pickaisle.induct2
% |4 E. X. d' ^  M# a6 M# F    while A_i<=30 do begin. w7 n, N- n" ^+ K
        travel to pickaisle.con(A_i)  K4 X* @9 z+ u- f: e- d% C; E" l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S( ]2 g$ B' e+ z- ~
        else wait for 10 sec, d$ d, s: `5 v
        if A_i=A_leave then send to die9 P* j# F! B9 `1 Y
        else inc A_i by 19 P2 I. j4 {. m/ y$ P: B5 i
    end
6 c9 C: i/ ^2 {% \" R! Qend
1 w, _1 [% a& e8 h1 W# W9 I3 R! q9 Y( R/ n/ R; p
begin P_pick3 arriving
) J) P  ]0 i( K8 _    set A_i to 21
$ `2 D- |* {, U5 Q" i    move into Q_induct3
( r; m1 v! E( V/ I) d    move into pickaisle.induct3
6 X+ {3 Y7 W) R1 R5 P5 K5 S# A    while A_i<=30 do begin5 D8 b, h4 \% f7 }
        travel to pickaisle.con(A_i)
# [& A) ~- `: k9 s* Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 v7 [. j& F9 l
        else wait for 10 sec) e8 }8 f# {% E4 c1 v% Y6 q
        if A_i=A_leave then send to die' M' i( |" G, o$ v1 T5 I1 Z8 \
        else inc A_i by 14 U$ K* a- Z/ y, W$ W  P1 \& S& n
    end
6 A$ A( b4 q/ r- E) R) P! }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是个什么东东?
9 O3 a8 F9 z! Q9 P0 kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) @& J( ~6 f' ?
. g. \$ K$ H8 ~# {! q% @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 m% q1 n! R7 R7 J/ {: t& g  c7 ^
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 X! X; Q/ W/ Q' K
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# J7 |- ?- C7 ~' O2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 w# Z2 _) a' r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* d6 ~' f' f) j; B
begin P_induction arriving
+ R9 J) h9 }; ]- F2 R    clone 1 load to P_pick(A_induct)
  c4 h* u; Z# K0 y4 Send最大的系
8 K" @  p! Y* Q, ]2 B: a9 @- `0 s6 y# e% }; @
begin P_pick arriving
4 P& _3 h. U0 F( Q5 ?    set A_i to procindex * 10 + 1
4 v# G( v/ m% P; u1 N' o5 `! E    move into Q_induct(procindex)4 b4 g2 J6 W* m% R
    move into pickaisle.induct(procindex)
. Z+ E+ L  P2 y3 a3 V$ I    /*check the type of pickaisle.induct(i), for your last problem.*/
- U6 a6 v/ s1 p  \* r9 V: l3 R# t3 M' F: Z8 Y  }
    while A_i<=30 do begin. g) o3 }& |! _# j. v9 K
        travel to pickaisle.con(A_i)
' E  h/ }( T( W* }. a, Q  Z* i$ |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* A+ g4 l  G2 G/ Q! ~  S$ W" p
        else wait for 10 sec
, S! g4 p, x  V# \% M* J9 L        if A_i=A_leave then send to die. ^6 a) o& _, W* L* ~& U
        else inc A_i by 1
6 o3 S  K, R1 ]0 z    end& k* s+ }4 F7 ]% B
end
$ i) _% a) Z0 e/ ^; `4 M' l  h" f5 F- }
其中的procindex为整形,代表当前process的序号。& M; q+ C* ?! s6 ]2 J; j; ?9 [4 K
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-2-11 16:21 , Processed in 0.017539 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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