设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13078|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 ?  ?: m. G) p3 ?8 r+ U4 h! p
2 h# P6 q5 f8 {7 |7 n% S我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& t  s) ?" c( p8 E' R
" W- p2 l5 j$ @& M8 d7 Gbegin P_read arriving. R; C2 \. D1 q$ W
    while 1=1 do begin
, k" Z: w) g" l% f; }        read A_tote from "data.txt" with delimiter "\n"0 p8 k8 }3 W4 U+ \) h0 V# V8 `
        read A_time from "data.txt" with delimiter "\n"' `7 o. Z. h* ~0 s& g6 T& ^8 C' N
        read A_leave from "data.txt" with delimiter "\n"
( R1 p3 y7 U; }        read A_picks from "data.txt" with delimiter "\n"
8 ^0 T; y, Y( f7 d        set load type to A_tote
: E8 m8 H6 j! n/ ~% l        if A_tote="tote 1" then set A_induct to 1
8 ]" a2 I& W; G        else if A_tote="tote 2" then set A_induct to 2
* z9 a! @6 }$ b1 }; N            else set A_induct to 3   
  M1 l& |" a  u: i$ I        set A_i to 0
8 o; R! @4 Q" S) p( w        clone 1 load to P_induction1 Y; j( E/ V6 ~% F* i% G
        wait for A_time sec* q+ F  d. T7 {+ M! J
    end/ r9 G- |! \- [5 d: h: d1 u
end% `5 e, M  v2 @1 z. G; i& t

/ f$ T6 N2 @( W" S; R- [begin P_induction arriving
# U  }5 {# A5 x' _    if A_induct=1 then clone 1 load to P_pick1
$ H. v) [6 O4 F' E) }% F2 P    else if A_induct=2 then clone 1 load to P_pick21 p6 J: v0 r9 m
        else clone 1 load to P_pick3# i% |1 _8 [- Z. ^
end
% s/ t( L3 ?2 N3 u3 R- ^! V! J1 ?  R9 {# q  h9 w2 @
begin P_pick1 arriving, B$ K2 ~! @9 G6 M1 E
    set A_i to 1
8 ]0 _' f& y2 q8 f    move into Q_induct1
7 C; r  ^; X/ ]  T$ R; s    move into pickaisle.induct1
( u7 E* g% L' J6 K1 Y) _: }    while A_i<=30 do begin/ e& C* \( ?/ E0 v
        travel to pickaisle.con(A_i)7 {  [0 H+ Z5 y! h7 e0 F  \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- u3 D" K5 s5 O  Q& p) d  k4 `
        else wait for 10 sec3 z, `: y- t; U. }, `/ y. ]; q0 U
        if A_i=A_leave then send to die- m2 \  B; b2 h
        else inc A_i by 1' J' `  B; e( _% k& F- z2 j
    end
+ L% J5 H! o' W# M0 c; Nend
% o+ F1 b% h8 r2 o) S4 \/ v& _; m9 N
begin P_pick2 arriving# G. S+ K; Y  A- y' W" ^* o
    set A_i to 11, `  T) N6 P) k: a0 ^
    move into Q_induct2
8 N! {/ N* P$ c    move into pickaisle.induct2
7 z5 ?/ b3 l/ p! f$ r    while A_i<=30 do begin  l. `9 C8 R% ^- ~! \9 {
        travel to pickaisle.con(A_i)' A" z/ }3 ]8 h  k. g. Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 G& A# S. P  Z" {/ ]
        else wait for 10 sec9 V4 L1 F- _  c2 c& I& r
        if A_i=A_leave then send to die5 y  k, B9 V1 q
        else inc A_i by 1  ?. G/ M- S+ I* p3 S) Y# i
    end, f; D" h5 S2 k. e% i
end
" Z2 a) A9 l0 U9 X
) c6 l  l9 s; F: R4 v' }begin P_pick3 arriving6 X9 s7 H5 F0 r3 l+ B: m
    set A_i to 21
% u! C( ?' p: Q3 p6 I2 c    move into Q_induct3: T, g9 ^) _$ J* j8 y/ m1 B' U# o
    move into pickaisle.induct3! s8 O7 \2 y9 h0 D) }+ i
    while A_i<=30 do begin; F% h, k+ O1 V) d/ `" _1 Y- Y
        travel to pickaisle.con(A_i)
" @- T2 I7 U8 u4 o' D' I* y& g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; W0 r; i# M' @: Q8 \
        else wait for 10 sec
/ q. o4 z5 A- ?& I" `        if A_i=A_leave then send to die
3 H3 w- M4 j3 ^' X6 q7 \8 t- A        else inc A_i by 1
5 C9 g" Q( k0 f/ S+ M1 l9 }5 w; V    end
( H3 C# D' T+ ~8 S( C6 ~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是个什么东东?
# H9 [! X9 G) B# Q4 {# amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: _0 s0 z! `; `$ D
% p' F9 e" }" a. NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' P4 R2 v& h6 g$ A+ r
6 M( ^* \5 [7 P
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  K! ?* _; W. M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  B( Q! T0 q3 r0 t9 T8 ^  N2 N
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 z( A/ o7 o) s2 N& i/ A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ Q. z) {7 l3 _/ G% |7 W0 Ebegin P_induction arriving3 g' I4 E3 N6 R
    clone 1 load to P_pick(A_induct)7 U6 k  N# x! K" `
end最大的系
% m' i0 B3 ~9 k, ]! D7 l3 r; \+ }% Q) v2 _* F" U
begin P_pick arriving4 y- @( n* J* N* {, c
    set A_i to procindex * 10 + 12 V+ S* W' [. P
    move into Q_induct(procindex)) K. w$ ~3 F# Q, f/ P! ^! E
    move into pickaisle.induct(procindex)
  R/ r* y" `. G, s: e/ k* I    /*check the type of pickaisle.induct(i), for your last problem.*/8 K2 E1 _; n% U( n* f
. W, F. N2 W5 r( _% I
    while A_i<=30 do begin0 s3 z2 A( f, l% l8 J" A* @" [
        travel to pickaisle.con(A_i)
/ r0 ~) n7 ?3 p, Z$ X. s) O/ M: X  X' }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) ]# I1 I3 }6 z% ?7 n
        else wait for 10 sec
0 Y* b9 C* {$ y- A        if A_i=A_leave then send to die
- v3 G" R) I0 J) I- ~        else inc A_i by 1
" h5 D/ v) M. n8 Y: E    end
% g! n& d( a! S$ Hend
5 J) a8 [: K4 l8 B3 t% y
5 W+ T6 n4 {1 b% S8 F# {* g其中的procindex为整形,代表当前process的序号。5 B& R" `, ?: U
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-3-16 10:39 , Processed in 0.018039 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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