设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15429|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' z; N# _6 p6 d4 f% e2 d; k4 Z6 w

" g+ a4 Q8 \; h4 A$ l我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ i1 U% k8 f8 |, ]3 @

2 W1 R! r7 H9 o* y: O7 K3 ubegin P_read arriving
6 M! F3 b2 w7 N) H! c    while 1=1 do begin8 s3 X0 X& M* X; Y0 f
        read A_tote from "data.txt" with delimiter "\n", Q( N+ |0 V7 L9 n' Z
        read A_time from "data.txt" with delimiter "\n"
1 T4 Y( a. J, g: h! r0 J        read A_leave from "data.txt" with delimiter "\n"
1 p7 X7 y2 Q5 ^* N: `" Q        read A_picks from "data.txt" with delimiter "\n"
+ |2 }2 Q! Y2 V# z, F* o. s/ R% Y0 o        set load type to A_tote! d4 J+ E1 E% }7 W5 y2 M% S
        if A_tote="tote 1" then set A_induct to 1! F1 }. f5 i$ }' a8 a
        else if A_tote="tote 2" then set A_induct to 2
! t& K' [0 C9 e+ [- Q! E            else set A_induct to 3   
' P9 r3 t. I' S( h        set A_i to 0
& A0 r8 V, u1 p" }        clone 1 load to P_induction9 H+ `( j, x  `7 }# C' m, w
        wait for A_time sec1 z/ E- ]* S& L+ B
    end. F) _0 e+ q' K3 K" f* g
end
3 ^# g4 b: W+ S6 {
0 z8 C( b( b$ I, I  Fbegin P_induction arriving
  o4 W8 A8 a# V  |' t8 z    if A_induct=1 then clone 1 load to P_pick1: K6 Z' s7 @6 G- A( E! z3 l0 t
    else if A_induct=2 then clone 1 load to P_pick2
% \. e! m, B6 `$ F2 M/ G        else clone 1 load to P_pick3
9 V. y; U3 F6 o6 e0 ^end9 t. q$ w' c0 o! M' V

7 y1 O5 k$ I4 j0 E7 H, j; c( Dbegin P_pick1 arriving" k9 h8 w- R- s2 X
    set A_i to 1
' \7 p; ^( c( b. u. [" V& I; @    move into Q_induct16 |+ Y" z% v0 z  x6 W+ f
    move into pickaisle.induct15 \$ c& N' L7 X6 ]* U+ Q
    while A_i<=30 do begin. j/ @6 _* g9 u3 i% [1 B" I
        travel to pickaisle.con(A_i), n4 G! B: x, o8 w& R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* Q/ k( a: ?2 ?. ]; _        else wait for 10 sec8 b8 N% g0 X9 a/ J9 B6 L
        if A_i=A_leave then send to die0 D* s( B- V% F5 E
        else inc A_i by 17 n- x- ~) f$ V* F( G
    end
/ C3 l& f9 w+ _( T! gend! N/ Y, K$ x$ ]& d6 T3 Y

5 Q! e. C* ?  s) @$ L; Cbegin P_pick2 arriving0 V2 I: T* K' A" r
    set A_i to 11/ w8 N0 \+ ?" n5 C
    move into Q_induct2/ Z+ [; y' X; z1 K2 L( `) F8 S
    move into pickaisle.induct2- c% r8 T& U2 j$ K6 z* `. u5 J
    while A_i<=30 do begin
$ h" i7 E# q6 T/ b' D        travel to pickaisle.con(A_i)
1 l- ~- u4 B  u) ~0 O) h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- F% b5 b& J+ j
        else wait for 10 sec
" v- v9 ?3 ]- x2 P( g: r        if A_i=A_leave then send to die( g# p5 R* B3 T# b9 {8 b* w0 }
        else inc A_i by 1) ?" V0 p: d7 l  Z0 ]
    end
9 ?& v1 r& v' y4 I2 Qend
$ U3 ~* _/ o5 [' C8 e7 L6 e% `8 Q' |7 O, H! @
begin P_pick3 arriving' K6 [) L5 ]! R# n4 ?7 e
    set A_i to 21( J& ]  t0 d+ a+ T$ j9 T
    move into Q_induct3
* F% `: B: @  _  {    move into pickaisle.induct3
) |( J$ x6 z- D* i# W    while A_i<=30 do begin
& R2 M, @' t! D- R0 t1 N        travel to pickaisle.con(A_i)$ E: H$ n  n$ d. L, g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 B6 }6 k$ }6 d4 B( [% }
        else wait for 10 sec
2 L9 }7 B& Y* C7 r, K9 g& F        if A_i=A_leave then send to die: q& _, d; }. b# ^5 D
        else inc A_i by 1
& R; B4 N$ n$ G2 f7 E; p    end  p1 Y. a, Q, ~2 x
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是个什么东东?& r3 F; ^0 T- C% v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' Q* g' G' m6 s1 \% e! k0 C

. @. O& e  |, C) \& R+ dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 G& D& _! v8 ~2 k
0 y4 O: {  F+ w) r1 i  {另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- v3 K$ d1 B+ d/ |& {, W3 O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" N& o" J6 ^4 D. \
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 T* {' [6 V5 j5 M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 W0 h* o0 y8 |' I% x3 ebegin P_induction arriving% D( y7 ]5 r; h0 x/ ]8 E0 l( a" I6 u' r
    clone 1 load to P_pick(A_induct)+ q7 H$ [' R# b8 O4 P
end最大的系0 T; S# g+ K( F7 T
3 |% Z- h/ Y9 Y  z* i# J
begin P_pick arriving/ C/ d! V" g' C7 [
    set A_i to procindex * 10 + 16 E4 g: v! J2 ]% v& A+ D# u
    move into Q_induct(procindex)+ C; Y3 A( n3 P9 T
    move into pickaisle.induct(procindex)( d, p( n. I' I4 O
    /*check the type of pickaisle.induct(i), for your last problem.*/4 r$ |' [% @0 h6 l) X: B1 D
7 M; E  S( E, J7 `, l1 D
    while A_i<=30 do begin, k% f. j' Z7 F- ?" T% n
        travel to pickaisle.con(A_i)
: ?- ]/ \0 U6 e, i: I+ V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. _% L1 B3 y& F% C: c, k1 j
        else wait for 10 sec. p2 D- \& f0 d, s( a
        if A_i=A_leave then send to die; G8 L0 d* j8 D+ ~5 O
        else inc A_i by 15 }1 g2 s4 b' @! g
    end  P9 `# d8 L# O" Y
end
9 n' k: S7 F- R& f% f' L+ D% b* N! l3 W2 s% y8 r: _
其中的procindex为整形,代表当前process的序号。
4 o4 W& N9 J# Z! q9 R* p4 tstation和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-9-10 14:40 , Processed in 0.020400 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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