设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13578|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 r: S, J4 \/ T* y$ |4 g

  x, A2 a8 ?$ `( T! E我的问题是,在每个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中的数值,不知道会不会有什么不妥。" Y5 U, ~; D! L
3 k* ?) l6 Q: _
begin P_read arriving
" f8 b% g  g( \    while 1=1 do begin+ ?& `. A; ^8 b# D# y$ X6 n/ _
        read A_tote from "data.txt" with delimiter "\n") ~: _7 V7 x% [1 l% b0 R) \
        read A_time from "data.txt" with delimiter "\n"
! X8 V" P: N0 Y* K2 B        read A_leave from "data.txt" with delimiter "\n"
$ Z; {9 x7 p+ z$ ^$ I, D3 Q        read A_picks from "data.txt" with delimiter "\n"
! r" L7 T  ~9 y3 ^8 K        set load type to A_tote' O" h# z2 z6 R* d& }
        if A_tote="tote 1" then set A_induct to 1
' |6 ?( z4 W2 C        else if A_tote="tote 2" then set A_induct to 2+ U6 V4 f! G& i
            else set A_induct to 3    0 q1 ?' b$ z/ n6 H" N9 y% n
        set A_i to 0! p* `- P, g; I. Z" z0 A# B
        clone 1 load to P_induction
/ L- @1 z/ M$ H3 F        wait for A_time sec
5 n! p4 m; C6 b0 s8 b5 V: ~    end
4 y/ A& D# v' {0 i7 cend
1 O; _+ _, g' f  a# H" g9 Y
. m$ W2 Z0 Y# i3 P! d6 a; V7 hbegin P_induction arriving
' }9 v2 b/ |, i. ?+ f    if A_induct=1 then clone 1 load to P_pick1, H& I! x; Y% Z; w( o1 y
    else if A_induct=2 then clone 1 load to P_pick2
0 Z+ ~# f$ w8 U  h! w        else clone 1 load to P_pick3
. l! Y: N; B5 T; hend$ R, W/ i2 e) ]. {% t2 w+ U
) `, a: O, l. U/ |" Q; N
begin P_pick1 arriving4 m, Q7 p3 n: e: N2 ]) I  P
    set A_i to 10 D0 o* j3 ~; s! c* `
    move into Q_induct1
' O5 ?2 U( @2 H4 {; b" d    move into pickaisle.induct16 S# U5 d7 ]0 v1 H5 A# K% M
    while A_i<=30 do begin
+ t1 V, R7 Z: |' r0 q0 g8 q3 @        travel to pickaisle.con(A_i)
$ R# l0 e% E: E( e# w5 ^" z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ Q" z3 E2 V# Z9 M' K8 X5 N
        else wait for 10 sec
/ [6 G* t. e( ]; V( `+ m2 C2 D  d        if A_i=A_leave then send to die/ W) V" O( _: B8 M, S' E/ Q. f1 w
        else inc A_i by 18 \# `2 z- j0 F/ ?  A- U7 Q
    end
$ ^5 y( T6 I  ~+ D% Vend
3 W3 |- Z( a: D. i$ [
0 |5 t5 n' Y& Q5 q! d" ^9 X; Obegin P_pick2 arriving
- g- y- d2 ~& ~2 u/ g    set A_i to 11
0 c& q: k4 m) Y- R& A) h4 g    move into Q_induct2" }4 }: H: Y. O* E
    move into pickaisle.induct2
( X. |$ ?/ A7 @) O    while A_i<=30 do begin
* m8 r6 s4 [7 O/ c* z! Z( @        travel to pickaisle.con(A_i)- ^9 |& y+ R6 E8 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 t  v+ W: g% W% C; f        else wait for 10 sec+ _* Y# \0 m$ U; d  B3 p
        if A_i=A_leave then send to die) @/ G7 P! @+ v/ ]2 L) G
        else inc A_i by 1
' l7 }+ a5 L/ O& Q/ G5 D    end
9 }% V2 `2 L# @. \  p' b* Oend! S2 C) f5 m* s/ L% _( X" `
) @. q& B0 k; e* d4 F
begin P_pick3 arriving5 ?: T, b! a8 Y! n9 X+ v2 R+ U" Y
    set A_i to 212 q0 ]: e" k0 v( i; u
    move into Q_induct32 f5 I( Q0 K& A" A/ Q" j5 }; C
    move into pickaisle.induct3  W: j* w, V! V1 y
    while A_i<=30 do begin2 L# z1 z6 \. y. a5 c0 h
        travel to pickaisle.con(A_i)  g; R0 m  U3 q6 c! n2 D. E6 s0 X# w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 w9 a+ _* k* r4 y2 `& [        else wait for 10 sec5 P7 k& y; f: {2 l& T
        if A_i=A_leave then send to die
8 S- S# A7 \. Q" `* T/ k6 [        else inc A_i by 1
; J1 d, c/ V7 c1 M3 [) p) a    end
2 u( G# e3 ~( B' ?# h+ }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是个什么东东?
; o+ Q" D5 I7 {  k7 hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- x( J  w, m4 g  N
' K8 `& r. \& l. P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 N& m, R! h$ \  e/ m
; F/ l/ B- F% K" j- E' q3 l另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 ], o+ r- \  G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# v  _- v* D2 ^5 Y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& n' w  f$ e( N+ q5 O4 U
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ [2 L/ m# c; ?% n3 ?- vbegin P_induction arriving
6 ?1 C: X5 n- c+ a0 Y    clone 1 load to P_pick(A_induct)
" n( x" y& m- Q5 \end最大的系9 a( O6 R7 h# }$ ~
3 I0 p8 X4 Q/ ]% E4 V9 u
begin P_pick arriving# D6 j* Z0 t: J/ p3 l
    set A_i to procindex * 10 + 13 K7 ^$ C6 \+ [9 A
    move into Q_induct(procindex)9 k: [1 t9 e# f$ H9 x2 f( B4 A
    move into pickaisle.induct(procindex)
- F$ ^1 w( R; C- p' w0 X0 v0 q    /*check the type of pickaisle.induct(i), for your last problem.*/) \& S0 d  x- N8 l( ?2 V1 a( ~

9 x3 o# b+ z( D7 z: n    while A_i<=30 do begin. |5 ?! l! a6 H$ i8 y& Y+ j
        travel to pickaisle.con(A_i)
& J& O+ ?) N' Z# S8 U# K- S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; d3 e8 \& ^9 i  t/ ~7 b        else wait for 10 sec
% Z9 f* z; J% m0 s. F) A' N( o& u; I        if A_i=A_leave then send to die
% f  c# f- _" _& ^0 m% p1 S        else inc A_i by 11 F/ F$ N- y0 F8 i/ S+ }
    end
+ _' A/ F: S  Z% y0 B2 D5 _, b# `end; B1 I5 \: [0 E# O0 {2 d

7 I& {0 w8 S% |! m/ A其中的procindex为整形,代表当前process的序号。
( A5 T- `% `9 d( r5 _2 R! Rstation和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-4-22 10:31 , Processed in 0.017357 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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