设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14007|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; c" H3 E! x( y2 @$ h+ y. ?1 U5 z; V0 I7 T  J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! V' j+ {1 h2 j+ Z, A% Z( V( F: V. j+ Q# a
begin P_read arriving
% A  ?( g: b, p7 z$ O% U& d    while 1=1 do begin; _3 x7 j: I" L. A
        read A_tote from "data.txt" with delimiter "\n"
2 Z" T5 i) v# b! `$ ], C        read A_time from "data.txt" with delimiter "\n"
* ^, v4 M6 D- L, L+ ~        read A_leave from "data.txt" with delimiter "\n"" a# _  x9 X  ^) T% u
        read A_picks from "data.txt" with delimiter "\n"
/ g3 c7 x$ Q+ _, A        set load type to A_tote7 x8 m+ }( ?* v$ ^6 g8 |% G, d% x5 m
        if A_tote="tote 1" then set A_induct to 1
: l0 l- j4 i- E! Z8 M2 U        else if A_tote="tote 2" then set A_induct to 24 f7 {  o3 m- V  u; ?7 ^
            else set A_induct to 3   
8 Y% S; t# e8 e        set A_i to 0! L* U& ~( q& j) X5 G" O0 y# d" \
        clone 1 load to P_induction2 Q. e( h" h4 [7 f' n, O
        wait for A_time sec5 Z7 V6 E7 L' R; P# Y
    end
% S% V5 d$ _$ G8 O0 o* U1 lend
$ `6 g7 W& j6 n; v+ @( D) S. u
# p/ B& n9 A; ?/ Ybegin P_induction arriving  X( _$ g+ d2 J+ {$ _8 r
    if A_induct=1 then clone 1 load to P_pick15 g' o! g; R' \- g5 i" Q
    else if A_induct=2 then clone 1 load to P_pick2! X. X( t; M' B  r- t( m
        else clone 1 load to P_pick3% k+ G2 e! S5 f1 t5 w9 p) D  ^
end
0 v& p" M" s6 b) K
9 @% ?0 b9 T+ h7 ]( I% X* Qbegin P_pick1 arriving
: v- `. \- B5 V- B& q    set A_i to 1
9 ]. ?5 t* f" c& v    move into Q_induct1
' R2 e2 q9 r' z    move into pickaisle.induct1
" y  L0 x4 H* M- K7 k; ~( o    while A_i<=30 do begin  q) Q2 P0 Q; \# T
        travel to pickaisle.con(A_i)( k. {  D0 e3 W# n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& K0 g* C: b. o( L9 D) [* A
        else wait for 10 sec! }# ]/ n5 V$ i2 K& g4 ]; T6 ?$ j
        if A_i=A_leave then send to die
! E  n/ Q% M; a+ E# @/ k, v3 B        else inc A_i by 18 _. i+ Q! e% F, s* f1 e$ v+ W
    end
+ ^! @$ R% l: Y  s% W, g9 a8 _end  @6 m; ~3 J8 K( ?
% I6 z. s, u/ F- }0 Y
begin P_pick2 arriving1 l9 W" U- T  o
    set A_i to 11
, v" r. ]  i- a. N! ~9 ^    move into Q_induct2
% U. P1 n. y" z  [    move into pickaisle.induct2
1 Z, g; T, M% m; t$ K6 x0 z% \    while A_i<=30 do begin
$ B4 E/ R5 Z7 `+ y6 @        travel to pickaisle.con(A_i)3 X+ N" X& Q8 ^/ f6 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 F$ Y2 E% `) L/ s0 m3 h        else wait for 10 sec' b$ s+ i' u8 L' ^6 A2 C
        if A_i=A_leave then send to die
" H2 ?% o2 d- ?; o& r        else inc A_i by 1
; X4 p( z, E, M9 D* H" T    end
- Q: L  r& v! m: W7 [( t+ _: u6 lend3 y& W% g$ x( }2 v  s4 J; W: a( I

9 i" D1 y- ]. e( i9 ]( Tbegin P_pick3 arriving
1 K* b' h0 l, \% T7 Y8 a    set A_i to 21
% M& |$ a# P2 R4 }& |/ Q. }    move into Q_induct3
& B- X# ?1 U2 i# F# m5 U0 B- Y    move into pickaisle.induct3; K% A, [* h) j3 [9 G
    while A_i<=30 do begin. l; }% N7 r. t. O  J( Z; X3 |- c
        travel to pickaisle.con(A_i)
, _2 G0 n3 Z) `& n0 `& W9 \- y! _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 e1 t- ?! B$ j! u/ X8 Z        else wait for 10 sec" U: W* R7 U% w! s6 g4 @! F" P
        if A_i=A_leave then send to die; x4 ?' T! T! K
        else inc A_i by 1
/ w8 o; J. Q) H! N$ G+ D    end( `, m5 W  S$ F: }! h; j: x( r& u
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是个什么东东?; N+ U8 C8 F0 X+ p
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 W& l" T. ~5 c
0 t! |8 B! f; n! R: J
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% ?0 J' ]; k! E/ y
% n) k, _4 [$ s  v% w
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 Z7 A) }( t, Y( k: ^5 f2 J
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) }% W9 G4 q( z, Z: r# y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 N, W! \/ r- N/ `7 k) u; _. c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 Y5 U- u( \+ u# h% G! o& R
begin P_induction arriving& `3 K8 j% [5 U  W/ ], f# e1 V
    clone 1 load to P_pick(A_induct)
4 K1 H) Z4 e; ^: |end最大的系
( E& v! r$ r* @0 d* p. @8 ~9 Y' Q
2 e7 p, @8 F: o3 ^4 ebegin P_pick arriving; W9 A: I. c4 V" R8 ^7 k5 `  _+ ^5 @7 g
    set A_i to procindex * 10 + 1% Y9 y6 U7 w+ U5 D
    move into Q_induct(procindex)1 R, S6 w1 A% O+ v9 S1 A
    move into pickaisle.induct(procindex)
- R' R! Z, a( M3 }: s    /*check the type of pickaisle.induct(i), for your last problem.*/
. ^# S+ h+ g0 J4 T
, V( ^4 s& G, u- G" |    while A_i<=30 do begin
: b* f( A  O  P9 o+ f$ O0 w& ]        travel to pickaisle.con(A_i)
9 W1 ]# v& s! _. ]: t$ X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 i  z+ [9 O* z, z) u! ~- E9 X3 S
        else wait for 10 sec
" s5 c+ i) m, v  m9 g: z0 N7 B        if A_i=A_leave then send to die
* t+ n6 W& O! i( K. M! Y, [- l  F        else inc A_i by 1
) ?3 z4 z5 q! W( g+ ]; ^* Z8 t9 |, H    end8 ^0 j/ z* S3 _  H1 j
end
/ a4 y8 w5 J. H
* y& \, J, s' B. ]  \. j$ N+ r" O其中的procindex为整形,代表当前process的序号。; [) E/ R5 W$ O2 z5 O! v3 L, B* 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-5-30 03:37 , Processed in 0.017369 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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