设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11844|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 b1 C2 G6 A) r5 o* J' {9 ~, z5 ~2 [# G1 P  X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- m" [2 R7 w  B# V+ @
4 H5 z. k5 f3 T9 {begin P_read arriving
3 B# P$ m$ R1 q    while 1=1 do begin( c* T+ I( o2 h2 w. V
        read A_tote from "data.txt" with delimiter "\n"
  ?) a7 K8 T1 W# ?) G+ U, j        read A_time from "data.txt" with delimiter "\n"4 M8 U. `. [7 s8 s, J
        read A_leave from "data.txt" with delimiter "\n"
9 x! b1 M- M$ X, C: M        read A_picks from "data.txt" with delimiter "\n"
% L5 ]: q3 R" D) W9 {' V% n) ~        set load type to A_tote
' C# Y8 c; U2 v/ r; g2 p        if A_tote="tote 1" then set A_induct to 1
% h0 Z" b" Y# ?% j5 T7 q/ T5 C        else if A_tote="tote 2" then set A_induct to 2
( X0 L7 [- \9 \# g) F            else set A_induct to 3   
, G9 ?  L8 R3 G3 d" l! |        set A_i to 0: z$ [/ ?+ ~; v7 w( @0 I, `! T
        clone 1 load to P_induction
2 _7 q6 f. }3 d. l5 s, C. Y" O* \        wait for A_time sec; Q; j; k9 N) R
    end! n1 W. o  M& x7 T, s" c  e
end: {! \$ U1 ~+ K4 d& t

. F7 w# J4 Q  X: L* q  _begin P_induction arriving  ?: c% w: r4 _; \
    if A_induct=1 then clone 1 load to P_pick1! J9 G- |: \: g2 K( F
    else if A_induct=2 then clone 1 load to P_pick2; q3 a3 G! L4 c+ R' m0 U
        else clone 1 load to P_pick39 D2 E/ F# U3 q9 M7 E5 k* r) O
end
5 j7 P, C; y9 f2 Q) ^
0 E( @( t0 F3 H7 p& e0 r0 sbegin P_pick1 arriving- i; s8 \  n# B: |  z( q
    set A_i to 1
, K4 Y( y0 E$ Q" P' E    move into Q_induct1
+ E1 }' P+ ~; K9 o& V4 ^, ^) L5 Q# s    move into pickaisle.induct1
" m2 \4 _, ^# e. j+ R* ]! o, s4 f    while A_i<=30 do begin
* f6 o, J$ }' O; h# a, N6 w        travel to pickaisle.con(A_i)5 {$ M3 ?7 y. x4 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; i. |: p# C  h' f/ V        else wait for 10 sec% x; q( p) b: _: [( Y
        if A_i=A_leave then send to die
1 _$ {  A, ^% l2 t& b' K. \        else inc A_i by 17 n- c/ h# l7 ?, _" p
    end
4 y2 ~: G0 I, U( U3 @; d8 e- send
' J7 W6 _( w7 ?
& ~4 I& _$ j! D# X4 {& Vbegin P_pick2 arriving
$ W" I7 h1 f5 ]$ ~( j0 C3 r    set A_i to 11
8 V+ ]; f, I# V/ w7 G6 P* n; z    move into Q_induct24 d  o6 ~4 z- K: O5 Z' ^9 j
    move into pickaisle.induct2% M3 u9 P2 c7 [6 B6 G. D1 W
    while A_i<=30 do begin
1 p6 E: y+ F6 Q        travel to pickaisle.con(A_i)$ P/ C5 z1 Y4 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ k; I) v4 K" C$ m2 L5 H% q
        else wait for 10 sec# h* ~! w; W4 l  V1 w2 ?
        if A_i=A_leave then send to die* C9 S. S: J1 ?3 w2 T! l
        else inc A_i by 1
' u+ i2 Z4 k9 b: i. w6 Y) r* E6 G- i% j( w    end
$ a. H* W/ W2 q7 e0 _, K( t# mend$ L+ N1 |$ r. @0 ~
1 Y# g3 t+ N9 F+ r# j7 h  Y
begin P_pick3 arriving+ v+ _: R7 N  ^3 E
    set A_i to 217 B( D  U2 [2 h( O% u4 u2 ~. \* Z9 i* h
    move into Q_induct3" d; [" X) b1 w+ F! ^( W
    move into pickaisle.induct3* l- V3 }+ w  P
    while A_i<=30 do begin& d5 u4 K4 |  m. @& [
        travel to pickaisle.con(A_i)7 c, Y- W) e! @4 s% {+ F5 `1 o) G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 h! o1 d4 U) q' ~# V8 I/ v        else wait for 10 sec( u+ J  X% t) w& U+ _
        if A_i=A_leave then send to die
' Q+ h1 Y' H" U! t/ g" n        else inc A_i by 16 A) Q; G  ]' W2 s0 k- p( x9 Y
    end- O, x! R, P2 X6 X( E6 w" d- 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/ `2 l% b& zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 Y  d2 l7 w) R4 d" N
! c4 d, a8 y# m6 WAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ A- d* P+ N( c3 U& O6 r
# G5 A" k+ L; N5 k8 q. f另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! ~! m" p! f+ ?, v1 S* ~* \4 G5 _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 j/ `/ i) z3 \: j) R9 g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- i- n2 u# V/ v' N; D" k3 R6 G2 Z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 x$ b# f0 V* z9 @1 t1 M9 Abegin P_induction arriving
4 m/ R" O, @* r0 G& x6 g* W    clone 1 load to P_pick(A_induct)
/ [, U( r3 S8 L: F  qend最大的系. _! \0 Z! E7 R8 ~' V% O1 P: `$ g

$ s! l) K6 X* w; h0 {- I. X4 Ubegin P_pick arriving% X( ]2 |+ X2 |) f0 a
    set A_i to procindex * 10 + 1) r1 W6 i& I5 e, E5 T5 u% i% ?0 l; O
    move into Q_induct(procindex)
/ D; a5 M' |6 e) r, _. l4 |    move into pickaisle.induct(procindex)
! i$ B( W( b! _" ^) z    /*check the type of pickaisle.induct(i), for your last problem.*/+ X- b9 Q1 t: v1 u( N3 R! s. Y

7 O8 B2 b5 _  I6 o% M8 T    while A_i<=30 do begin) G, ^. o6 ?+ m& |
        travel to pickaisle.con(A_i)
( q: c0 z0 L5 M/ g6 t( z. g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! |5 V. j+ q* _  u  g
        else wait for 10 sec* ~: S) P" {+ R) k1 q" b1 m
        if A_i=A_leave then send to die
) U8 Y9 ]* M: v. T        else inc A_i by 1
% Y6 k0 ?0 a1 _; V" m9 m* F    end8 ]3 Y$ m6 K* ^( x( L
end. E+ X/ C3 u- H$ g

% b) ~5 o& X4 g+ s' T其中的procindex为整形,代表当前process的序号。; m/ S+ f9 P5 }' C$ c) F) 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, 2025-12-9 16:07 , Processed in 0.018404 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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