设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12505|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  g9 ]! f+ P! i! f. B2 @( P+ m3 A7 w4 m/ ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' ?6 E( ?8 h; V" c) b% S
9 u' x% Y: W1 B6 l2 g
begin P_read arriving
4 J. \  j6 N0 `+ u& h    while 1=1 do begin- N# v; }: D" v8 e
        read A_tote from "data.txt" with delimiter "\n"' U% W  g2 J& Y; N& d
        read A_time from "data.txt" with delimiter "\n"& u4 h  o7 c7 B. a) x
        read A_leave from "data.txt" with delimiter "\n"; `: J6 V/ Z* T8 i4 V/ ~5 N' k1 n
        read A_picks from "data.txt" with delimiter "\n"
% b% N# `9 @- }% m( r        set load type to A_tote
  G4 x8 F# h* ^        if A_tote="tote 1" then set A_induct to 1
5 C- k3 o! A+ H  z/ N0 l, t        else if A_tote="tote 2" then set A_induct to 26 d6 B8 C9 [5 z# Y
            else set A_induct to 3    3 H: j! e. `2 L, C! E% |3 a
        set A_i to 01 \7 x: }" c4 Z
        clone 1 load to P_induction
$ v% g! P+ d: m- @8 C* e% r        wait for A_time sec" q  l8 O5 b# W' `2 j7 E0 J
    end
* ~1 Q9 S5 ?$ |% _0 h1 ~  Jend) e( T" C0 |) B/ X; b9 O' l

% _) ]1 u; x' B) Cbegin P_induction arriving
  ^8 U5 F5 V5 Y* J8 ^/ ?$ z5 a3 g2 [    if A_induct=1 then clone 1 load to P_pick1$ k7 b, N+ k. o' d1 v+ N2 B4 i( u
    else if A_induct=2 then clone 1 load to P_pick26 ~" z, m8 [1 T* P
        else clone 1 load to P_pick3
/ V' W5 f* Q3 t6 n& Send2 g6 w# t3 M9 g: z+ J$ D1 h- r
/ F1 z5 j  F4 i* O
begin P_pick1 arriving9 Z6 i7 @8 J6 ]' h% U* s
    set A_i to 1
6 I6 M9 `" e: ]1 q2 j    move into Q_induct18 v( G7 w: S$ G( n1 o
    move into pickaisle.induct1
$ c8 q' U  c; ~    while A_i<=30 do begin* i4 I+ O) z. w9 l) C
        travel to pickaisle.con(A_i): K" p0 y+ e; c' q0 ~4 f4 h; P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 ~4 V3 {# x! W# {3 a* a        else wait for 10 sec7 Y+ Z# q, p+ f3 c' G* ]
        if A_i=A_leave then send to die
. S) [) v1 R% S2 h6 E        else inc A_i by 1
. g% `' I* R1 o# T    end3 D2 j3 g% l  M0 K( j: |  F
end
' b4 U/ X& T1 {6 e* G+ o8 z' V# d! D
begin P_pick2 arriving6 [0 t! v! i9 o7 ?
    set A_i to 11* i6 M: ?. F$ o0 @6 r
    move into Q_induct28 R0 z9 Y  m% L
    move into pickaisle.induct21 b* B' Z1 H7 K
    while A_i<=30 do begin
8 u* [6 L! j8 V5 _% A& A9 k        travel to pickaisle.con(A_i)
3 [" }+ v, E! w/ L+ [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( X# o/ ?/ H4 [' g; W1 W
        else wait for 10 sec# D, O5 r3 X; B- w/ B4 l8 |9 X" k
        if A_i=A_leave then send to die8 o0 [5 J  [. ?
        else inc A_i by 1# i" q# c/ c9 i3 b
    end" h) h* ]0 p. y
end3 Y% U- L+ j3 k! X4 o
& U: C* ^5 q( x" D* f& X7 o
begin P_pick3 arriving" @7 W2 N! a" h7 y8 B; j7 z
    set A_i to 212 b! q! _5 I1 g6 x" c) K
    move into Q_induct3) Y* C: `" u  z
    move into pickaisle.induct3# }& X' N& S6 c0 S
    while A_i<=30 do begin, q, e# Y6 G7 s* r- B0 k9 w
        travel to pickaisle.con(A_i); z# ?% A  d% K" B& r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# |/ ?5 C! A4 _5 |0 ~9 N; C; U
        else wait for 10 sec
  G! ^& [+ V% r" `# [        if A_i=A_leave then send to die% _8 ?; F# Y* x% H. x; _5 ]
        else inc A_i by 1
" s! h9 J) v/ ]& i" D! B+ r3 K, _- J# o    end' {6 q8 V7 N9 c* V- Q+ o) z
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是个什么东东?
9 `8 K& M8 k9 }; I" amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 j+ t7 r; i) a
% U0 h' G  L+ h% Y. n
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" Y0 l; m: C0 s% f

2 b1 o! D7 s( X: k0 T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 m5 m- I$ |/ @/ U+ D( @
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! h0 `( ^" R+ }, S2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 [: p3 i: N; b
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ @/ t, ~. l5 K! e  P* H8 Z7 z
begin P_induction arriving+ u8 E; ^4 w; N$ [
    clone 1 load to P_pick(A_induct)
; u( ^  Z: h  e  U& I% [% O/ cend最大的系
" ?# M0 t. D# g0 @7 Y8 ?6 f# j% q( l/ k; D) h
begin P_pick arriving  Y8 M& d+ i8 j. u
    set A_i to procindex * 10 + 1
+ s( ~0 @! p, V5 _, u* `. p    move into Q_induct(procindex)7 R% Z7 t" L  [% m; i3 n2 \
    move into pickaisle.induct(procindex)
8 ?: O4 e3 Q/ k  R6 `    /*check the type of pickaisle.induct(i), for your last problem.*/
! Q7 x, d9 [5 y( ~! W' g3 [( ]3 X; h, R9 Q' @
    while A_i<=30 do begin
, ~, b- _  {  p        travel to pickaisle.con(A_i)
! j- J" w: ^+ g& z( i) t: `( L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 A; F6 z" |# m) V
        else wait for 10 sec( q/ h" y+ j% V- e0 Z; ~
        if A_i=A_leave then send to die' p& E. S; m5 K$ W
        else inc A_i by 1
. T' E# j. y/ u' S    end
- v, e. b9 v8 o! u. mend% J7 p, j6 O9 {9 v. w& `

4 ]2 g& ^3 m# l9 D3 Q+ n其中的procindex为整形,代表当前process的序号。
5 W6 Q- j2 V  P- `' ?! 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-1-29 00:31 , Processed in 0.013102 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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