设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14544|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 ^7 i+ X# e" H) p$ g( u

' a6 u7 @' g9 @2 [; g  P1 T/ `我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 Q; [: \  i$ Y9 E# b
: P+ F0 h$ v+ R0 [! D) @begin P_read arriving/ ]$ ]5 A' W1 B9 f0 U
    while 1=1 do begin
8 z$ l" Q5 E) U* _3 b/ j+ o+ @        read A_tote from "data.txt" with delimiter "\n"
3 k1 r' i8 G; A8 ^& }        read A_time from "data.txt" with delimiter "\n"
5 ^# P. d7 m( [, a$ \9 g        read A_leave from "data.txt" with delimiter "\n"
0 S' S3 z5 Z1 g+ e7 a        read A_picks from "data.txt" with delimiter "\n"4 s3 Z4 D* o$ N  E; E1 m0 X
        set load type to A_tote
* j) g5 P0 V3 a        if A_tote="tote 1" then set A_induct to 1
5 P  u& o* J/ Y( G        else if A_tote="tote 2" then set A_induct to 2- {5 L6 j$ h) X% |/ x4 F# H7 q1 `, t
            else set A_induct to 3   
  o: a' W. P) V- n. C" o        set A_i to 0+ h. w* C. j+ v- t
        clone 1 load to P_induction+ r8 `3 a' t4 o1 D4 H; e! T1 W
        wait for A_time sec. v8 ?' I, m' r! c5 W0 Z
    end+ M2 @) p1 F5 `3 d0 L5 a/ \1 i
end
  \5 W- u: w2 v  t7 ~* x# q2 f6 m( w! c1 m, M$ D8 o; Q) n
begin P_induction arriving4 ?  X1 E+ o( q* V6 w/ R" N
    if A_induct=1 then clone 1 load to P_pick1+ G, d8 T1 o5 `/ f$ K) j
    else if A_induct=2 then clone 1 load to P_pick2
# ]8 Y5 F# j1 a7 ]" j        else clone 1 load to P_pick3' `: D+ }9 v& Q, _' x
end" Q% `% b% K% m

2 @% a1 f: O: S* wbegin P_pick1 arriving6 G0 Y9 R5 J% ?* I& W8 @. v
    set A_i to 1
0 I& R: U0 G3 Z3 n  b    move into Q_induct1+ }! p- y1 t+ A/ o, u: e
    move into pickaisle.induct1
4 _* {+ {! d: D7 T: Y6 d    while A_i<=30 do begin
0 j! w* n  _2 [4 S: K        travel to pickaisle.con(A_i)
: J/ V. V) Z; R& B. ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* {% O4 \$ {0 N7 g- h
        else wait for 10 sec
, b7 L3 q; B' v, K6 i% E        if A_i=A_leave then send to die
1 ~: \! a" W, P; z2 c2 E6 w        else inc A_i by 1. y) x# I( N2 h/ B0 \5 v
    end
+ _0 b5 A# i- c8 i' A4 t: F  Uend, ~, y: s+ d9 o4 g) r( b
% E' U, R) ~& m1 C
begin P_pick2 arriving
  U: h5 b3 `. h$ N0 r    set A_i to 11( l# @% U) I4 N7 R8 S& r
    move into Q_induct2
' P& N* R6 ^" d  f1 @4 A3 L    move into pickaisle.induct2
& _4 {$ p4 G! r: J) |    while A_i<=30 do begin
" c! E# \  x  ?; B) S7 ~+ k        travel to pickaisle.con(A_i)6 N, ?  Q8 P7 G/ k1 |$ g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ r2 _  \3 Y0 W2 T# J6 U+ g
        else wait for 10 sec" f. Q* w  L4 s2 ~' G/ c$ g! j9 v
        if A_i=A_leave then send to die
" u8 [0 \* J1 J        else inc A_i by 1! D9 U" W) B  i1 E8 H
    end
/ `5 x2 O8 x& d5 X: z7 K+ Aend2 r3 P- X4 n5 o0 R+ ?
% Y6 u- i5 X7 d$ V7 z" J
begin P_pick3 arriving
. L( O) k2 W/ z    set A_i to 21' f; B$ K3 }- {4 F
    move into Q_induct3
4 T- \/ A2 W* q1 X; O    move into pickaisle.induct3
2 u, N* Y- ^! }% h6 W    while A_i<=30 do begin4 }, ?- u$ ~8 L0 B( `( {" O. k1 m# `
        travel to pickaisle.con(A_i)& B4 W% F" G, ]) @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 p- Y0 u# t& j# _4 ?4 a% E+ N
        else wait for 10 sec
6 J5 C" G4 G: Q- A        if A_i=A_leave then send to die$ k4 T8 l5 E2 m/ U& _/ a
        else inc A_i by 1# n  |' d& F' m7 A1 @/ K
    end7 R) i0 k0 H; O
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是个什么东东?
' y; y+ ]: q2 Y- \move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 C* r8 u) b' }# Q
0 b0 ]4 P# Q7 K: V7 tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 t; B( V# ]4 P% @/ a1 [: i+ G2 E, Y& ^+ P' B2 _2 t
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: d( E0 Y* r% _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
- d: Z" q6 G. ]0 C* U! ?) ^3 q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; F$ _( O! @/ d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 N& a7 |) e- X# o* {( p# cbegin P_induction arriving
, N' ^5 I1 W: T4 n! R$ A    clone 1 load to P_pick(A_induct)- Z) S9 r+ ~/ Z+ }  s
end最大的系
: n% G" k0 T4 k7 t- p! W. g3 k) k
begin P_pick arriving  r9 M. n- {1 K
    set A_i to procindex * 10 + 17 T; p1 z+ h5 ?' ^$ C+ M
    move into Q_induct(procindex)7 R% H$ c) |: k
    move into pickaisle.induct(procindex)
1 V( `1 m3 l0 T! j* p; d    /*check the type of pickaisle.induct(i), for your last problem.*/& u* L+ r8 j, r- a' X
; {. w& }3 x1 T
    while A_i<=30 do begin. x9 o3 {$ s# |: C; D0 D
        travel to pickaisle.con(A_i). Y% s: ]& ?  X' P0 w2 e2 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) C  N  t' K! s: [% T
        else wait for 10 sec% p+ o" p1 k8 a5 C6 [, J
        if A_i=A_leave then send to die* T1 o7 @+ `) b$ X3 R5 ?: {
        else inc A_i by 1* b0 R1 [3 f4 k
    end# H1 Z8 K5 v+ p3 a
end( F( x" e/ l$ \; t# v

, t. }& [9 u  y8 A9 Q/ Y( Z. ~其中的procindex为整形,代表当前process的序号。" L! ~9 X' h9 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-7-16 15:03 , Processed in 0.021857 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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