设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14530|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  z! X8 A- q2 {" @
/ W: m1 g$ G2 _* ^' D3 S/ 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中的数值,不知道会不会有什么不妥。
- g$ p/ u7 e( l/ Q1 |% A7 S2 C
- h" c* g0 }! {begin P_read arriving
9 E. O# y- K: a! K4 Z5 a/ s    while 1=1 do begin
  ], J5 c' q( A4 Y* s        read A_tote from "data.txt" with delimiter "\n". A2 G3 A4 h2 }! D' ?. ~
        read A_time from "data.txt" with delimiter "\n"0 t9 ^; @- z2 [+ a0 N* \' [- q
        read A_leave from "data.txt" with delimiter "\n"5 r2 g8 M$ j# S! Y8 [% W' y
        read A_picks from "data.txt" with delimiter "\n"# v( e/ B! j8 |4 N9 Y  [
        set load type to A_tote  s& E+ z3 \3 m4 R+ V5 f$ M
        if A_tote="tote 1" then set A_induct to 1( {. ~8 S! c' t) @. d2 ^9 j
        else if A_tote="tote 2" then set A_induct to 2
$ d/ r$ Z% Y* T+ Q5 n7 m: n            else set A_induct to 3   
6 L2 |/ a8 b4 m$ a        set A_i to 03 L4 E& {6 l! |, U/ @' Y
        clone 1 load to P_induction
/ d3 A3 `7 Z' V* V        wait for A_time sec4 ]( \" M5 X0 ]# ]+ r8 J8 n) ^
    end! ~  N0 e! n9 x; d& \
end
/ P, I, ^% }$ `/ C' m% g! C
4 ^$ t9 m) A4 H' W8 L( nbegin P_induction arriving3 M# Z; k: e0 `& z
    if A_induct=1 then clone 1 load to P_pick1% R. c3 |% z) V
    else if A_induct=2 then clone 1 load to P_pick2  D0 |1 O- d+ q5 E
        else clone 1 load to P_pick3
5 f, M# i+ I, I5 {. o, Oend; R1 h9 y. v& @& }) r% A
+ ]6 h$ l6 U. g) d
begin P_pick1 arriving5 Z4 X, h0 H- Q2 K
    set A_i to 1$ F* `3 B! |6 Z1 C6 Q; |+ c: {
    move into Q_induct1
# _- V% Z) ]! ~  j0 ^0 q    move into pickaisle.induct1
5 Z3 o$ T; J. p# p0 K7 h+ T9 ?* B9 ]    while A_i<=30 do begin0 B7 s  E6 K# G4 O8 h5 v
        travel to pickaisle.con(A_i)1 m9 J( R3 E# @/ T3 F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 v" s( }  H: l( d, j) Y/ C; M6 g        else wait for 10 sec# E% F- |% ]  ]2 F9 R- O! c
        if A_i=A_leave then send to die' I$ a  o+ I3 H& L
        else inc A_i by 16 N- _8 S, F; ]9 L
    end
' H$ T  R# ^1 [) B$ U- p* ~* oend
' y6 h0 j8 a  R7 }$ i
, U& T0 T. t1 H# rbegin P_pick2 arriving
- @  [& {* o$ S4 C    set A_i to 11
& _0 K7 ?1 \/ G    move into Q_induct2
: c! g5 I$ m& q6 `- w; h) f( M    move into pickaisle.induct2
! C# ^& D6 N& U1 f* o, r    while A_i<=30 do begin
: K. ]) m; O6 s- ]        travel to pickaisle.con(A_i)+ v3 V! x. h3 ^# {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ B7 |5 d) J5 Q( \        else wait for 10 sec
% b* R" M0 w- r+ |        if A_i=A_leave then send to die# c& I+ n* C5 y) b) _
        else inc A_i by 1
5 e. i- x: G$ y: [  \8 m7 p, G/ M    end& D1 w6 T! _; M" }" s' q
end5 j. y3 i' G& @8 S9 q3 a; w& c" H
# K1 ^* ?" k& s2 p, }* x: }# G
begin P_pick3 arriving/ m8 k/ \  F6 r0 V2 o
    set A_i to 21
) \, Q  P6 X* J5 _; {, \) a" w2 J    move into Q_induct3
0 S; D' h! R5 c1 u8 a  A    move into pickaisle.induct3& ?# ]7 r- P, q2 l$ U8 c
    while A_i<=30 do begin7 q( y6 W  Z; n6 r2 ^6 s
        travel to pickaisle.con(A_i)) ?/ e' ]; _% }4 r1 W( a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; h* K6 p3 _3 F2 q" j5 j        else wait for 10 sec$ g8 ?& X0 c* |
        if A_i=A_leave then send to die. j' Q% t9 c* ~, u% N) e
        else inc A_i by 10 G& s/ Z5 a3 K& s, U# f
    end5 p  v. N* [1 p4 l; J. w! 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是个什么东东?
/ @. [4 {0 |" y. p8 @move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ c. k; s- I) Z  V) T
/ {1 e& S! I' Q' q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 p: S3 h# V# t; S$ C& a" U" ^& a$ t! H# u! c5 F
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 ?5 I/ ~/ d8 w+ e" Z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( w  ~8 U0 ?8 o, [! X- A" Y: B2 J2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. W1 e. F* z4 ?# V5 Z( V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ Q0 b, n; d: z$ f; dbegin P_induction arriving
# W0 D' ^# }# k2 z! y# q8 w9 e2 `    clone 1 load to P_pick(A_induct)( e9 f9 i1 U' Y* U! {& g0 k+ z0 ]
end最大的系
# |. u  ~' W7 I0 \; g7 y2 i: r5 l# {
begin P_pick arriving
. Q9 n! V# q9 K" Q8 b1 H    set A_i to procindex * 10 + 1
2 F( P- u6 U: @* r' G1 o    move into Q_induct(procindex)+ v% |( H, F. ]: l3 @! E# G$ t
    move into pickaisle.induct(procindex)
! v, r1 W, d) ?4 l; A    /*check the type of pickaisle.induct(i), for your last problem.*/
7 \/ n2 a9 S7 _. Z1 L1 m& ?4 e: k" p8 i$ S  C
    while A_i<=30 do begin* x  E6 w: V* f2 ~
        travel to pickaisle.con(A_i)' v& L. h. I. n  S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! `6 ~  E- `3 r3 H$ u3 T        else wait for 10 sec4 W8 r- P* A& Y8 _% m% [
        if A_i=A_leave then send to die
8 Y  J8 Z5 Z. q6 {& g  E( B+ A% j        else inc A_i by 11 J* |% k* l4 A1 W
    end* Q: K7 O1 `" @. b4 F* \# b
end* U0 P$ q9 [, B3 ^9 I8 y- ~4 r# R* i

; a" u( N8 m, Q$ o其中的procindex为整形,代表当前process的序号。
% Q2 j2 d& M1 ~station和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-15 06:48 , Processed in 0.018189 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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