设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15320|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( r% Y$ Z$ _- r% ?# q9 W: A+ q+ i8 Q0 z$ W8 Z( k$ b4 E6 |( B( I
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ x" D9 N4 m# t: E  Q% }$ z: C
7 _+ B: G% h5 |) |) V8 ^/ S  s4 }begin P_read arriving! H" Y% H# _7 H1 J) ^5 s$ Y
    while 1=1 do begin0 M* S; b7 a3 }  H, M
        read A_tote from "data.txt" with delimiter "\n"9 x+ S: }) }0 |8 c' |5 {0 V9 H
        read A_time from "data.txt" with delimiter "\n"
: Z9 R' c# T3 F! Z        read A_leave from "data.txt" with delimiter "\n"
' F: f6 e$ w$ S7 ~8 g3 P8 ?        read A_picks from "data.txt" with delimiter "\n"
9 m; m9 x2 _. T& v; R        set load type to A_tote
9 d+ |4 }5 v: o0 K        if A_tote="tote 1" then set A_induct to 1& c  i9 v- g; K$ }7 S( y
        else if A_tote="tote 2" then set A_induct to 2' L% _/ c/ o4 S. k9 j# J
            else set A_induct to 3   
8 Y. I) E' v( ?" W2 b+ O9 O        set A_i to 0* _* V: o: ~0 E9 Z' }
        clone 1 load to P_induction
/ T% L+ G6 n. A        wait for A_time sec1 {1 z& p2 J/ [# o
    end
% H0 B4 `4 j6 s, l1 K4 H* h, uend+ w0 j2 }7 X6 Z

, A- p1 S5 Z9 C) Q# R/ q1 h; \begin P_induction arriving8 y; W1 `) V# _) F% z+ v
    if A_induct=1 then clone 1 load to P_pick1
% p3 N6 @- _' v/ A- g2 S    else if A_induct=2 then clone 1 load to P_pick2
" d8 X, i& n3 t        else clone 1 load to P_pick30 A1 x; F5 `* x- p' }; u2 ]
end
; s  E; B6 e/ ?9 O% d
: P6 }3 }& h; N" ^9 {0 H5 J7 obegin P_pick1 arriving' B/ L1 g+ d- h& L/ s
    set A_i to 1$ O: w1 U+ ^( K% L6 L  ~# p
    move into Q_induct12 K' ^7 }; y. B
    move into pickaisle.induct1
0 k, U& n! r7 y4 E    while A_i<=30 do begin
! o2 ~+ v0 U- k0 Q) K2 n( o" v* q        travel to pickaisle.con(A_i)
9 @5 {, N9 Z$ W4 t/ u) ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ R4 x+ h3 i: r        else wait for 10 sec) @6 I. c2 g/ p% a% O+ _/ c/ ]
        if A_i=A_leave then send to die
3 R5 G1 F! Y, p5 F$ w, C        else inc A_i by 1
7 W5 |  V: u2 P, [6 P    end3 s0 v1 \2 r0 c
end
& f. P( v- J; C! W) P% }& Z- A! ?) k) Q" b; n, F
begin P_pick2 arriving2 Y8 n9 `7 L5 x
    set A_i to 11
8 u* `3 J/ ?, E" L6 z! h9 p    move into Q_induct24 m/ S% t6 b7 P( h; _
    move into pickaisle.induct2
' A  g* `2 q* W" ^    while A_i<=30 do begin3 r+ W5 [$ \, S! j9 J% a' m
        travel to pickaisle.con(A_i)2 _- W0 J5 @& Y! ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ ?9 f# U7 o8 |$ @
        else wait for 10 sec8 h4 F- a5 S  y! M$ r  H
        if A_i=A_leave then send to die& k) Y2 d/ {2 _! L5 S
        else inc A_i by 1
3 q! k9 L" B0 W1 s6 N    end. r9 S8 t* [- v
end: {8 l  \3 V3 o
' W6 e, j; P( W
begin P_pick3 arriving
3 p5 c% A- ^& z% B6 }4 {+ n# f    set A_i to 21
; v/ O# L3 f; B, i$ N+ l+ {    move into Q_induct3* S# L7 U2 e0 O% r
    move into pickaisle.induct3
/ I. h1 b: t% \" T6 p" o    while A_i<=30 do begin6 z. ^* e/ r8 p* E' G/ j$ |6 y2 J
        travel to pickaisle.con(A_i)( P+ {. g. z3 A* p  R" e/ E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( Y5 J/ b7 R6 q, q/ z        else wait for 10 sec. z. e5 ~% `" ~. O; T
        if A_i=A_leave then send to die6 F$ f1 O+ x9 N" V0 g7 Q
        else inc A_i by 1
7 c& \: A1 F5 x/ u" ?    end
% R- ~0 G5 D+ V/ Eend

最佳答案

查看完整内容

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是个什么东东?
$ V- z# C3 p( Smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 J7 ]/ M: ?0 M0 ]& [5 V. k

  Z1 h3 Z; ^5 i8 T6 a+ l2 ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 T; j( O0 b+ ]3 x8 D
) T( @8 u0 r" g# V/ S& u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ x7 A, B, a' B; w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 X; S  `% W% d% @( ^' _2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  k5 a6 ^$ @5 L+ q# v" _  ~
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 O; ?: Y, s: c7 u7 _2 abegin P_induction arriving- @1 t% Y* {9 y: c8 Q! Z
    clone 1 load to P_pick(A_induct)
! _$ F3 S; Y: D( Y/ jend最大的系
, P) a  m4 }" k) C/ {) b& ^- W: [- O8 u8 F6 _( n/ |8 G
begin P_pick arriving' @4 u- \6 U! F1 b: i% a: V% z
    set A_i to procindex * 10 + 1
  S% R, z0 v1 C    move into Q_induct(procindex)& T) }! s" ]( N2 R
    move into pickaisle.induct(procindex)
# U) ^5 [" }/ W4 Y    /*check the type of pickaisle.induct(i), for your last problem.*// M2 @4 H2 d+ @

( p2 L5 m/ M% d/ ~- s7 Y    while A_i<=30 do begin( [2 u0 M0 @) A" i8 J* q
        travel to pickaisle.con(A_i)
% b. U4 K, W  ?, y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: |! Z2 u9 d6 ~( k" o, B4 q
        else wait for 10 sec* i5 R: G& u& `% @; |
        if A_i=A_leave then send to die. Z; E2 e. X' g( q  h3 B3 d0 ~
        else inc A_i by 19 f9 }! p. f5 z/ Y- a( M
    end( h* S3 x* _! |' x" s+ L
end) L$ J# ]& v8 J

' l# V& E9 N7 W( y' f5 ~& T& H7 G2 ~其中的procindex为整形,代表当前process的序号。
5 y# [( S7 Y2 [# |5 Wstation和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-2 10:35 , Processed in 0.013762 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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