设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15177|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 S9 q3 N* W: F
. a! P1 \) \- O我的问题是,在每个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中的数值,不知道会不会有什么不妥。; u. {- m+ F+ r$ D% }. ~/ h

7 i5 C$ y+ |! C6 Y: _$ F) J1 Y1 fbegin P_read arriving
  M" D0 C. C4 J/ U    while 1=1 do begin/ d5 d' ?4 h  c5 _8 }
        read A_tote from "data.txt" with delimiter "\n"
9 }, d9 b/ p/ ]4 c& h' m        read A_time from "data.txt" with delimiter "\n"
/ z. M; Z% z% t        read A_leave from "data.txt" with delimiter "\n"
! t- F' z+ `' s( {        read A_picks from "data.txt" with delimiter "\n"/ U. m5 V" j5 I9 e2 [
        set load type to A_tote
' w7 K3 ?5 }6 [2 x4 b        if A_tote="tote 1" then set A_induct to 1- e4 G5 {3 e' g, h8 i6 x) y5 D
        else if A_tote="tote 2" then set A_induct to 2
' w0 ~; B& c* z9 A            else set A_induct to 3    - k( ~, @2 m* H% x( m
        set A_i to 0
. d3 K3 ]/ A( f) t9 e! f  ?        clone 1 load to P_induction5 \6 J" t5 t4 \% S0 U
        wait for A_time sec# x8 R& \; a5 l2 L( d# m! Q- j
    end
( ?5 Y4 d; {/ X$ ?% I" C- ^7 j  Fend
6 C% G' L8 N* B! E2 f! F& Y2 `! E/ n
begin P_induction arriving/ H+ B: ~4 m" l4 @1 l. H
    if A_induct=1 then clone 1 load to P_pick14 d( h& t+ Z0 U1 m
    else if A_induct=2 then clone 1 load to P_pick22 W( i- w/ r0 E- W* g% l8 d% i
        else clone 1 load to P_pick3& g  A5 `/ R2 C6 `/ i. i# J
end( F" |5 W' d5 S2 Y; w

$ g2 a+ R. Q1 Qbegin P_pick1 arriving
6 e0 H/ {6 C" C: I    set A_i to 1% x+ S$ z  _6 A2 G
    move into Q_induct1
% L# l( @' P+ E    move into pickaisle.induct1
5 g' \' |, A  |9 Z$ v    while A_i<=30 do begin
& R3 [; x/ o# {  O6 j        travel to pickaisle.con(A_i)
% a/ s( _$ i+ Q' Y2 G. x$ F/ O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 y+ f  n" Q. c1 N8 ~( N        else wait for 10 sec
, ^. P3 Z! F9 b6 E% z        if A_i=A_leave then send to die
/ R3 H8 a! k7 v+ H5 e& p        else inc A_i by 19 B9 Y) }  K5 v
    end
1 F  V" s5 P! y- t2 Eend
* O8 f5 J" O7 Y8 w( R& |: z/ ~* I7 Z7 i
begin P_pick2 arriving
* l5 ?9 n- E. p  m: \- C/ h    set A_i to 11
5 D5 F0 V$ a3 d. b    move into Q_induct2" U  `. U* x' l  e$ G9 K
    move into pickaisle.induct2, m. A" U% @2 |4 f$ `7 x' R
    while A_i<=30 do begin
' g2 `& v6 |! _* a) _        travel to pickaisle.con(A_i)0 t- |* f6 ?: X1 h7 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% u9 \& {/ N2 i9 @% w        else wait for 10 sec4 r, J/ D) S6 L' r
        if A_i=A_leave then send to die" w8 X0 j4 u/ {- R6 w
        else inc A_i by 1
( W* l3 v* r8 O6 @8 z    end7 |1 Q+ \' Y% f% K
end/ R1 t- @; [' \5 S- Y* ]) c

1 x% g6 `0 U4 C1 o/ I8 vbegin P_pick3 arriving% Q5 S! u7 @0 ]: u9 `/ H
    set A_i to 21( s- |* q3 I' h3 p# N6 P& d
    move into Q_induct3- Q; N; d; B5 ?- ?' X( r$ w
    move into pickaisle.induct35 Y9 X0 D, I' T$ s# k
    while A_i<=30 do begin
, I9 O. p# z- p9 F# M$ g1 s        travel to pickaisle.con(A_i)/ d" L, b0 G7 A- ]) o# o" L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 q* b6 N$ T, \
        else wait for 10 sec
% _% K0 I9 d5 `- r  D1 M) V        if A_i=A_leave then send to die$ ]  S+ j6 a% z/ H+ V7 s; I! n% d
        else inc A_i by 1, i& o! W# q  c; H8 J1 w9 ], R. p  P
    end0 c5 N) A" v# `3 K7 m
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是个什么东东?
# [8 a; H  X- u% y: _$ Z. O7 Vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 e& `3 S7 ^0 A+ ]( n" ?
& a9 {1 Z0 x4 G. I6 ?$ DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
+ J5 E4 O" |6 V- m3 U5 T7 C9 m6 k+ u' X
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# ?' h% Z: ?7 U( I6 q0 t
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' s7 Q+ B1 E5 G6 {( U& }
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  C( S# S; H. V7 `% E) y/ B% M" L3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* p6 ?6 ^3 r! K+ \+ k$ fbegin P_induction arriving
) P. }" H. }' X( K    clone 1 load to P_pick(A_induct)& Y! W/ V4 j+ Y, R, _6 _% e# d; `
end最大的系, c' S# H  S0 E5 W  w6 t+ b
3 n- M4 \, ^9 ?  l; Q/ Q
begin P_pick arriving
1 Z: R. Q+ E5 I% E! j6 M' P    set A_i to procindex * 10 + 1% ?8 n7 S, B' y  G) e! f
    move into Q_induct(procindex)
8 g" Q" `8 A7 n    move into pickaisle.induct(procindex)
0 }/ K( |$ H3 l! i8 b    /*check the type of pickaisle.induct(i), for your last problem.*/
9 {# y; l9 j% u% H8 I( h" }
& ]# _" _! T. A  a6 Z1 Q& g    while A_i<=30 do begin0 L/ X3 I3 j; X* X: M
        travel to pickaisle.con(A_i)5 X& m# y8 s* K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  n$ {8 e7 e  H
        else wait for 10 sec
3 J% R% P" A7 ~# ]' Z5 j        if A_i=A_leave then send to die
( o/ I9 F% ?, i- Q) ^$ ]        else inc A_i by 1
+ `3 H) c) S1 A1 W& T) ?6 @    end  R0 L) q2 X/ y0 a7 c
end& `) L3 ]  x: O5 D5 O1 X
: ?4 [+ |8 Y1 o5 v/ V! y* Z( J5 S
其中的procindex为整形,代表当前process的序号。
  q# Z) A+ B0 G% C0 o9 B/ \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-8-19 23:31 , Processed in 0.018102 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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