设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13493|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 A1 n3 G) A# q9 T: j8 T
8 u8 i. G0 _% C1 w! g& q( z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: W1 i. M& W$ @/ `& P( y
( c2 V. {$ G9 R3 U. k2 ?begin P_read arriving% L7 v& n2 ~# B: y9 M5 O
    while 1=1 do begin
$ Z. u' ?4 l' S# ]2 C) \        read A_tote from "data.txt" with delimiter "\n"& p1 P' n& t- U( E0 i& e
        read A_time from "data.txt" with delimiter "\n"
9 _% a, @6 r! f  @1 Q+ }        read A_leave from "data.txt" with delimiter "\n"
' p/ j9 H3 I+ G5 |: Y: V/ E% N        read A_picks from "data.txt" with delimiter "\n"% I6 Q9 [. V) \) u: \- g) T0 U
        set load type to A_tote, ]6 v$ S' U* [' A) v
        if A_tote="tote 1" then set A_induct to 1, v2 T+ k% E6 l: [# q+ Z
        else if A_tote="tote 2" then set A_induct to 2
: A. c+ H6 W- U" I- }3 A1 p, x            else set A_induct to 3    5 R+ V3 `# |' \: V9 r+ n
        set A_i to 06 d6 j* E1 T, ^! U% x. M" |
        clone 1 load to P_induction
7 c! D  A- T, L0 w) {8 E        wait for A_time sec
: @& a% p8 m9 g7 Y# @    end
4 ]& v; S  y; N! `% q5 b: gend
3 R0 \- j7 }$ B4 }, F
  p6 ^$ h* t( c2 e3 R* qbegin P_induction arriving
  B4 }$ m' G& M, _    if A_induct=1 then clone 1 load to P_pick1
; `- m" C: ]5 L& l    else if A_induct=2 then clone 1 load to P_pick29 d- r4 c( \, N8 t
        else clone 1 load to P_pick34 {9 e- s$ E' n$ X/ G' e& w+ T; ?
end
% d& r( l( R5 s0 {3 \0 ~* S
% M: U5 V3 Q: \8 nbegin P_pick1 arriving
  S( ^! @  v* i% ]4 Z    set A_i to 10 ~- g( ~3 l% ]
    move into Q_induct1
3 `2 u8 I* O  G  P  a$ d5 w" Z    move into pickaisle.induct1. }& w5 e. H+ h+ U+ x/ b' c
    while A_i<=30 do begin
! z# w) h0 x' L. X. }        travel to pickaisle.con(A_i)
/ l: q3 q, x( ?, g2 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& I; O3 C' S7 n4 c% O        else wait for 10 sec0 ?2 B' W. d! @$ G8 u1 s% b
        if A_i=A_leave then send to die
# B4 f5 t, B8 L  @* E        else inc A_i by 1
- H7 I! G+ K( z/ _* i  ^    end
% H+ c8 s, e- G9 O4 @end4 C3 o7 }6 }# {: G
+ F0 R( |; l% r& |5 l8 F
begin P_pick2 arriving
7 ~1 }1 f# K% g: A3 f) X    set A_i to 11
% e  ?) b7 {5 S" N0 s$ O3 ^3 X    move into Q_induct25 K! P) w0 K, J, S
    move into pickaisle.induct2" L8 [$ X& {3 f% l) I' O$ v& q
    while A_i<=30 do begin2 c4 j+ o- @$ M2 k* @  Y
        travel to pickaisle.con(A_i)) j1 \+ R+ l4 B: f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 @& e( u: @  e5 G        else wait for 10 sec1 w/ Z+ B5 W! P% s
        if A_i=A_leave then send to die
8 u7 O' F2 u% _& f8 ~        else inc A_i by 17 B1 f- S% S; P/ N. J# c/ ]4 w& n
    end& Z8 l. {' M4 P+ z; `+ U
end
( w; Q& o/ e6 ]% S
, ]2 s7 e+ \, M. U0 Ebegin P_pick3 arriving
+ L9 g' _! g7 A% B- @: E  b    set A_i to 21. R2 ^0 d7 F0 ?) `5 p6 n1 a+ Z7 B. v
    move into Q_induct3
2 N% t9 l* Z( r    move into pickaisle.induct3; I1 u* X! F/ }! ~" u- ?1 u; q+ b
    while A_i<=30 do begin5 d- O; Y4 f; q+ X' p' u
        travel to pickaisle.con(A_i)- F4 e) f+ y9 {0 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 f+ f6 \; R; U
        else wait for 10 sec( J4 E1 u; b4 v7 y6 [) B
        if A_i=A_leave then send to die
# }/ W1 n/ E. j* f( C        else inc A_i by 1. d: g3 w' o, e: Z8 c* \) \( n
    end- Z: _8 ^1 m. Z& u; ~1 r& ^; m7 l( K
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 O; t! b: A; x4 H3 G) z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  h2 f; n% f1 z- u8 [# N. h$ J
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ o/ O$ [6 G0 K, M- R
) M+ }0 b# Y1 g/ |
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: }$ U: Y  M+ Q: Z& F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 y8 u/ U. e, m0 u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ a9 ~7 _7 j0 F. ?' h' |3 K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' B$ p4 f6 e& H$ h
begin P_induction arriving
, |  x8 s. o4 B3 I    clone 1 load to P_pick(A_induct): t4 l/ F5 B# t( T7 T% b+ J
end最大的系
- x5 R* E' F/ [( h/ t3 M6 Q; g( u9 b/ }! y
begin P_pick arriving
' W- K) m7 z- Y& t0 u: w+ k    set A_i to procindex * 10 + 1
( o8 Y9 o  b* _( E8 k    move into Q_induct(procindex)
2 h8 C% C2 V8 s0 d+ J% L& o: j! R    move into pickaisle.induct(procindex)
+ f) d# v' Q3 h- Q8 [/ z4 R    /*check the type of pickaisle.induct(i), for your last problem.*/: x4 x% i7 S* C6 B' k+ e8 R/ o
. o7 }9 ?) {6 l  t% j
    while A_i<=30 do begin
# N) m, ?2 I# j9 O; g        travel to pickaisle.con(A_i)7 M" c. A' T% b0 }3 @! f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 C7 K  Y) E; k5 N2 Z+ m; g        else wait for 10 sec1 `6 c( H) T- C: \' T5 w
        if A_i=A_leave then send to die5 C/ T% a3 ~" K; r% V! _' o* P
        else inc A_i by 1
- W- g( B" Z5 X; n( A5 P1 c    end
) a/ L; q& N8 S1 {9 q' j7 i' Hend
- e3 j+ f8 S7 @) {, u+ P) M& |# ~6 r
其中的procindex为整形,代表当前process的序号。7 W5 Y* F( D+ l: a9 v
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 18:01 , Processed in 0.020934 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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