设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14659|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! e8 F7 j, Q7 ]2 h) x: ]* W

3 H6 }) w( P; O' A, y7 H  @我的问题是,在每个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中的数值,不知道会不会有什么不妥。' A5 [6 }6 W- _, G0 d
& M5 G, j+ {) P$ S
begin P_read arriving0 M' y  A9 k% I3 z2 }% p: U! W$ o
    while 1=1 do begin- p1 Q0 }$ K" p2 Y
        read A_tote from "data.txt" with delimiter "\n"/ p' k* s7 S6 ^, H% d
        read A_time from "data.txt" with delimiter "\n"
0 s% S: L! y& W8 B/ C        read A_leave from "data.txt" with delimiter "\n"
) E- ~. ^- ?. n+ \4 W        read A_picks from "data.txt" with delimiter "\n"
4 M9 W( f' B" x* F) V! I: g        set load type to A_tote
# Z" n: B4 ?  u5 E1 s! {        if A_tote="tote 1" then set A_induct to 14 t4 ]6 W. G! }1 X) \1 o# Z
        else if A_tote="tote 2" then set A_induct to 2
1 A; J% Y2 z  R6 t0 e* k+ V/ l  b2 q            else set A_induct to 3   
9 F# }2 R6 C3 k3 _) j4 X- u        set A_i to 0
, |5 {* S+ ]4 v. C+ c        clone 1 load to P_induction
8 w, }6 f6 o+ m: P4 x( P) R: A  ]        wait for A_time sec3 P* e5 D+ d7 ]% B: s6 ]1 @
    end1 e! U9 h4 Q$ l6 ~
end  N! r# m9 r( \4 B1 a
# N: t. E) g7 P+ V2 V
begin P_induction arriving
; U9 ~  H! N. t& M9 a, x    if A_induct=1 then clone 1 load to P_pick1
0 t; @5 s  Z( Z6 Q- I    else if A_induct=2 then clone 1 load to P_pick2
3 K+ s- E$ `' _* X8 i" ^8 F& |7 T        else clone 1 load to P_pick3. v0 ?8 }0 |# T% }" |+ I( ?5 Z- ?
end
/ l3 k( z' M4 p
. f' v, b4 n0 c9 Y- _begin P_pick1 arriving* F9 r0 f  K, u$ w% x8 c7 g0 ?6 y8 F, ~
    set A_i to 1: z2 x! I& w2 _) E4 }/ }
    move into Q_induct1+ v0 k7 J" W3 z7 x/ ?2 t
    move into pickaisle.induct1
5 Z/ }! g& R3 _2 p$ V    while A_i<=30 do begin
" v! E( Q( R9 x% Q6 F, f        travel to pickaisle.con(A_i)
+ c3 r" I* U+ U8 q( Y% _# x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( \1 L! Z- B2 A! z2 v. Y7 D& |
        else wait for 10 sec* r( Y1 V/ `# T7 L/ J' s
        if A_i=A_leave then send to die
2 M8 l( w# a7 {. X" [( h# D        else inc A_i by 1
5 k- B) n1 A/ u. n6 j    end
3 a7 t3 Y; G3 C7 B9 z& b$ cend
- z6 n' y% G5 \
: t" v' ]: n7 |3 ~0 F' n' hbegin P_pick2 arriving2 i% A  `. e) V9 F4 E! t) I
    set A_i to 11
1 y4 P4 K9 q: M    move into Q_induct2
* n3 H! k) @% M9 V    move into pickaisle.induct2
/ r! e  s- X  v    while A_i<=30 do begin
3 M4 R7 \1 J# r  o1 _        travel to pickaisle.con(A_i)$ \5 [. i, a* J  t3 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 b! g; O0 h9 b; F! V  s
        else wait for 10 sec" _" f6 Q7 t6 t+ W. y: Z
        if A_i=A_leave then send to die, H/ Z( o- \! y9 D+ v# h5 e
        else inc A_i by 1
4 F) P/ }* @' g2 U2 s    end) b1 q$ L0 q, W
end% s, ~* L7 o2 ?" [6 _4 v
% I3 G. A  o, H$ [4 P
begin P_pick3 arriving
9 h; [( C! u. Z* H  k5 R( v    set A_i to 21
# j; ~  u1 r4 V& O0 e* z9 I    move into Q_induct3
' F: h# \9 l! P" c* r9 k- R    move into pickaisle.induct3; ^0 A+ \! F) Z; @6 T- R
    while A_i<=30 do begin4 I) x; u! m1 i$ q
        travel to pickaisle.con(A_i)
# I% C; d# o, ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; R# i2 ^  v. H3 k$ V- x4 x        else wait for 10 sec
7 I  N; Z' b# o$ C4 q        if A_i=A_leave then send to die
! l0 H# w5 `! F/ H, G        else inc A_i by 1
3 G: T4 T, a; @& S  V" V  q) v    end+ G8 w0 X5 n9 l2 d1 _  F7 J
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是个什么东东?4 i0 L+ T- t- d3 F( e$ N) D6 P/ Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; b+ W  Q) U) Y6 d% T- ~. B3 [
8 S- T0 l0 j; \" ?! hAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ B3 r" `$ j5 _- Z6 n# f

5 `7 N- |- w9 t( H2 ~# _" I2 d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ m, T  Q# q+ }' G- ^  m
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 k6 b- x: U+ i! V; f% y- y, ?2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 {: n- I) t7 w4 c3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& u( m4 h& }# d( c3 A
begin P_induction arriving
* d; E( \# q3 @2 J9 L& T    clone 1 load to P_pick(A_induct)1 |- v8 v1 H5 d( x& Q
end最大的系
' X, _9 D% G' G0 G- }$ ~. {  r* r' ?
begin P_pick arriving* O7 U9 M/ ^2 Y1 u- _
    set A_i to procindex * 10 + 16 \* Y7 H) k) O# w9 R2 ]
    move into Q_induct(procindex)
  T% [# G5 u/ `- O, `5 Z    move into pickaisle.induct(procindex)5 z; x; {( f) K4 s$ D
    /*check the type of pickaisle.induct(i), for your last problem.*/
! `2 }' F6 f6 G
- o" I7 S; ~; P7 l    while A_i<=30 do begin& U3 O- L3 {) X2 j9 `4 i' \
        travel to pickaisle.con(A_i)/ R1 e- }. j, M* k* ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ d6 @  X( c# z. y! `1 h' j) V* w        else wait for 10 sec( |! \8 y  l  K7 [! p7 Y4 K% ~
        if A_i=A_leave then send to die
/ h& U$ I- A  |& F2 N% Z        else inc A_i by 1
" k/ I! U& }! W" Y    end# ^, Z! _' c4 Q( K8 L
end3 {# ]% c4 w% c% b2 M4 ]

0 B6 Q% A* o2 \$ `+ G+ }1 G其中的procindex为整形,代表当前process的序号。
! |* a% S; L# ]/ ostation和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-20 03:19 , Processed in 0.020878 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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