设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13018|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. a, Z/ U+ u" F' i$ `, X4 l, [) F  t3 O, p7 v
我的问题是,在每个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+ i; c6 s' m/ E+ y
6 [5 ^! {& @" d" K5 A# k
begin P_read arriving- k, Z+ ?; S" S. ^$ n
    while 1=1 do begin( ^6 w- K: d9 X
        read A_tote from "data.txt" with delimiter "\n"
: o# V& p" A2 ]" D/ I; \; z9 v        read A_time from "data.txt" with delimiter "\n"
9 [. r" |7 Y% K        read A_leave from "data.txt" with delimiter "\n"
; s+ G& P; i* Z5 e- |        read A_picks from "data.txt" with delimiter "\n"* D+ i: G% c: P+ B
        set load type to A_tote$ d  a  g: d4 f. n
        if A_tote="tote 1" then set A_induct to 1
& g& @5 D+ X* o+ z        else if A_tote="tote 2" then set A_induct to 2
4 m# D9 N6 X( U3 e& {7 @3 a) E            else set A_induct to 3    4 z8 Z3 K  y& z$ D9 |
        set A_i to 0: N6 p/ D8 L! o+ y$ Q4 z4 O) q
        clone 1 load to P_induction
( x( b; C, w  O7 Z        wait for A_time sec
1 x! V* e8 s% z) u+ R' ]; u    end9 v1 Q. S* |2 ?$ U% v
end
4 g( D: ?7 i% P; i, q* R, A
$ g0 b' G1 s( @" o: D& @" v& ibegin P_induction arriving" q" }( V2 W2 n: J
    if A_induct=1 then clone 1 load to P_pick1' j% a, K3 p- ?6 p
    else if A_induct=2 then clone 1 load to P_pick2/ Y) ]$ Y& K; m
        else clone 1 load to P_pick3" Y' p1 K" n+ [" A) O+ |
end
% l6 C" _4 A8 o0 S& n  ^8 b+ G% Q) n8 C& U% \9 J
begin P_pick1 arriving
; _5 g# S9 j/ C; j0 O7 t9 l0 ^    set A_i to 1
# A7 S2 t2 e8 ?' N    move into Q_induct1
- ^% A) D+ u# K% m, |9 b/ T    move into pickaisle.induct1/ O6 D3 F, F5 J. u! o  v6 A
    while A_i<=30 do begin
0 D' ]! [  C& l- ^& v6 M+ ?. o2 K        travel to pickaisle.con(A_i)" G: [8 D1 g* v- }2 A8 p! u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  L0 _: [1 Y) n: j( }2 k
        else wait for 10 sec
( k, q: @" ~- ~. ^- d        if A_i=A_leave then send to die
+ Q- k% q* W6 q" b, `3 }$ H        else inc A_i by 19 v* J1 {. |: |) ]( N& z
    end' ^6 y, ?0 m; |# m6 z
end, j( a, p/ Z5 ^3 x

% e7 X6 y6 F  t# S+ q- v6 N' lbegin P_pick2 arriving0 B3 T* ~" r) I! t6 o" f! J. Q
    set A_i to 11
8 m) ]" G, G2 C# D" ~    move into Q_induct2# v9 S0 n, z7 z* X
    move into pickaisle.induct2  \9 o. X% M0 ~. |! C) ]
    while A_i<=30 do begin* H, k! p6 w) }# p; E
        travel to pickaisle.con(A_i), o/ X: S" u. n+ u3 F- X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# h; d6 x; n' I* g        else wait for 10 sec
. F* t+ u% ^, @; A2 w) _5 p* l" W        if A_i=A_leave then send to die$ R% F& a) c9 i/ q
        else inc A_i by 1/ w6 }. |3 _; [3 K- M% @
    end2 S1 R3 P% a  k) \3 a
end* T6 C- j) ?7 o3 V. w5 g
5 y1 \) M* X2 B5 e
begin P_pick3 arriving& v0 q; {% X$ ^
    set A_i to 213 ?5 s2 Z* N( d
    move into Q_induct3  r# }" E4 R( d3 C
    move into pickaisle.induct3
* x' v2 n3 T! P1 `$ ~    while A_i<=30 do begin
8 s" V# S7 V& Z        travel to pickaisle.con(A_i)
& i& c( m5 v3 _, n; m6 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  A7 s; {1 C, W* H4 A2 ]
        else wait for 10 sec5 C0 H7 z5 K( P! ?% ]
        if A_i=A_leave then send to die( Y5 n, g9 E! N0 l7 ]3 q
        else inc A_i by 1
8 L4 {; ]1 O2 @# r    end
$ B, d$ R: Q# |7 qend

最佳答案

查看完整内容

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/ K7 g, h; v- x8 _! ~move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  q  ^6 c& {7 `+ g0 o/ x

) t- q" h; t/ D9 k! CAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 t* ~+ u* D) c( z0 Y; k  B, p8 H0 Y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 R" h! m# H4 I) t. k; H9 C( Y5 Q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; ?% `8 M; Q3 c4 u& @% b
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ W( v* |% I: e0 c, _; i* M3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 U; S0 W2 I0 ?9 r
begin P_induction arriving
- {' n  N% c3 s& L7 E8 ?! ~    clone 1 load to P_pick(A_induct). q, z% _$ s, ?; K: }
end最大的系7 M; }4 p6 c! A

. @5 F, n5 i$ W( cbegin P_pick arriving7 g6 ~7 h* p/ X5 Y% S* u% k+ G9 x" ^
    set A_i to procindex * 10 + 1
+ S& l0 T# X2 t+ m7 w% t5 {; h    move into Q_induct(procindex)
) ~7 M% F: x+ [; B4 i' b6 h    move into pickaisle.induct(procindex)
( k1 [/ r( T: e/ I% B    /*check the type of pickaisle.induct(i), for your last problem.*/
' A4 t/ W, J* W' u6 L0 R9 J, W$ {$ i
    while A_i<=30 do begin2 n! [* \  w' I) B3 ^
        travel to pickaisle.con(A_i)+ L, {( c2 X7 x0 l4 U. \" g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 h/ O: y0 d$ U0 O: C2 ?
        else wait for 10 sec
# K( M0 `: u" g# v) T- B        if A_i=A_leave then send to die
' `8 U. O' ]% S* K/ ]+ L        else inc A_i by 1
. Z* H2 Y4 @6 h* |7 g) U    end
6 `! T3 u/ |; ?) }2 d# Fend2 s* K- l0 D1 t9 @$ ^! r. ~  O

: @$ a5 }# |5 z' s) @+ u8 m+ Z. w其中的procindex为整形,代表当前process的序号。
1 D( b( |2 D- Y$ G/ ~. lstation和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-3-11 15:42 , Processed in 0.020699 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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