设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14256|回复: 2

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

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

2 |: y) U7 Q  H/ A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ d) h- v4 h9 C7 }( j( a# r$ C, f& Q# V6 X
begin P_read arriving4 b( @5 I: e, P7 L
    while 1=1 do begin
5 e( C4 b( S3 ~/ }0 ]        read A_tote from "data.txt" with delimiter "\n"
; w. N3 p( N; G3 s! r        read A_time from "data.txt" with delimiter "\n"
- |& c# P( C! l; C, ]- l/ t        read A_leave from "data.txt" with delimiter "\n"
$ r' T+ C/ ^: d- t& [        read A_picks from "data.txt" with delimiter "\n"
. U) E# K2 R* d# g1 w        set load type to A_tote
. x; x" N0 k3 u1 s        if A_tote="tote 1" then set A_induct to 1% \- r1 ?* S  n) X, B( f! |; U
        else if A_tote="tote 2" then set A_induct to 2
$ V4 X! `& t# r7 E            else set A_induct to 3   
! {- J0 \! Q& O! [( B& D        set A_i to 07 z3 C/ w4 K* V/ a! R
        clone 1 load to P_induction; D1 `2 g$ c+ ?7 l! a0 D2 X/ T
        wait for A_time sec
/ W2 B$ q  t* |9 C    end2 P0 f, i& h! d- F- p8 P
end/ W4 C) L& b4 @! k1 \4 e

% q: {1 m, Q9 u! i- b! Dbegin P_induction arriving
% a1 Y: W, g2 t( i: y' `' H    if A_induct=1 then clone 1 load to P_pick1
6 Q% Y5 G' Y2 I# [    else if A_induct=2 then clone 1 load to P_pick25 O% R$ J& C- n) j5 n  b. i
        else clone 1 load to P_pick3
: o5 @! E7 `' S0 |2 Aend
  Y/ P! m4 Z, h7 d( T7 ]3 ?% ?: u: K) `+ d( r  ~2 |. r. C
begin P_pick1 arriving
, d. Q: i3 ~8 `! x# G* H    set A_i to 1
6 @  [, p( c& q0 p# G0 I3 j    move into Q_induct1
3 o% y: U6 q' o- y; z* o& A    move into pickaisle.induct1; |6 K: T% N" g- M: Z2 a
    while A_i<=30 do begin0 V9 r  A1 V: ^7 H0 I2 N
        travel to pickaisle.con(A_i)! c6 w; a* j( W& Q% n3 \, `3 P3 y" f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  c3 ]. O* C1 g6 \        else wait for 10 sec& \1 B( z9 f; G0 G
        if A_i=A_leave then send to die$ j, \$ `8 B+ C$ c' J' e
        else inc A_i by 1& e7 L2 l, V( X" n
    end
9 z7 x! m8 O. I# a' O. f+ @end& v4 A! v! C) T) L: u5 z$ w' J/ F! Q
) P& m7 |  c% R- ?) u' E
begin P_pick2 arriving
* K3 w6 D; W5 b# w    set A_i to 116 d# q4 z: `/ W$ ^
    move into Q_induct24 F3 K7 C% K! Y
    move into pickaisle.induct2
, e! j+ q! G: A+ x: B: D! y    while A_i<=30 do begin
6 q: g. @; Z; e* M  V        travel to pickaisle.con(A_i)1 G9 |6 T9 z+ L5 ?8 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# x9 h, o/ \) |5 L' z7 C4 i. Q
        else wait for 10 sec
1 ]! u* B7 l# d- {+ a        if A_i=A_leave then send to die2 `  c- C( ~, |1 N% p0 ^
        else inc A_i by 1% c7 {, x# K- l$ ]5 h. l
    end  K( J0 g7 a! W% x: l
end
( z$ n" ~, Z+ O  T7 X6 A
2 B6 W. F1 l! G; @begin P_pick3 arriving9 x3 G( x& j- ^( K" |
    set A_i to 21
0 N, b+ ~, L( ~/ s4 k, x% H/ g& y    move into Q_induct3
# M% D1 F- G; C+ S  A" t  J    move into pickaisle.induct3
) \* f5 ~8 R4 W! h3 f/ @    while A_i<=30 do begin
2 `8 g* L5 l/ d. J% W( e  n, d        travel to pickaisle.con(A_i)  @2 ^+ ?- I6 Q5 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: r! X' B( O& B' W2 C/ N, m        else wait for 10 sec
4 m+ Q# \1 P+ ?3 e        if A_i=A_leave then send to die
1 \2 _( Z) b; k7 _; t( E        else inc A_i by 1' k5 D' p* b  u& P2 t% ]
    end! j( N3 U8 }2 Q$ N
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是个什么东东?
: p, p2 V$ j' f/ |. vmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: U" d! V: F, B+ w0 i$ S6 d* S( a' q( d9 ^
) A/ ~6 ]* w" v; `) k& X# u4 k( `1 }AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 H) `+ Y! |% u1 |3 f( b7 W" U
- X- r1 B* G( y  O
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* E9 h( h* H1 X8 H8 d/ V1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;. _9 K. Z  V5 ]! J+ M. w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 R  ^3 p4 d4 R9 t! V
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; ]3 V8 D$ e5 g$ M, `8 O
begin P_induction arriving
+ A; m3 `" t5 K( q2 A    clone 1 load to P_pick(A_induct)9 {8 |: ~! ~6 M/ r: m/ j  S
end最大的系& p$ N  I& M$ }- S4 n
, F+ a* b( W  f' m$ `2 m$ K
begin P_pick arriving! F4 }4 w1 D4 U4 y
    set A_i to procindex * 10 + 1$ u( `+ X. N1 p7 W
    move into Q_induct(procindex)
, i  n1 O& t7 _$ D- c, _: _    move into pickaisle.induct(procindex)2 z  m. p9 x, ?
    /*check the type of pickaisle.induct(i), for your last problem.*/
% R/ b- F4 {& L1 {& G+ E8 w; K* @8 M/ X. n; E
    while A_i<=30 do begin
3 K4 H& h4 k! v7 \5 i1 X        travel to pickaisle.con(A_i)
1 Y0 Y7 n' t- W# Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  h: y4 j2 C7 V
        else wait for 10 sec
- o* ]% Q7 B6 M  i' L        if A_i=A_leave then send to die
& m! d0 J8 J: F4 w+ h" a& a        else inc A_i by 1
3 }# L4 {; b/ j    end
4 q2 R- d8 {2 z- dend, A) _( i' c) P

& |5 V+ W! M$ \4 d其中的procindex为整形,代表当前process的序号。
" Q$ s0 _( Y8 D- ?1 Nstation和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-6-25 11:05 , Processed in 0.014748 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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