设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12738|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- `- I. l- d2 ]4 ?2 T5 o; u% L! [* f) P& u7 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中的数值,不知道会不会有什么不妥。
! ~, ?( f  K& L$ L' m! G8 k6 w+ B( M( T4 k8 c( g" }) |' g9 L* V- x
begin P_read arriving
5 A% H( m1 M+ u    while 1=1 do begin* B( }4 P5 l% N0 n8 y$ m
        read A_tote from "data.txt" with delimiter "\n"% x0 X# t! Q& t" |9 g0 v
        read A_time from "data.txt" with delimiter "\n"
9 p5 i: `1 u0 J        read A_leave from "data.txt" with delimiter "\n"+ u, X4 W6 K9 W9 b9 [& A
        read A_picks from "data.txt" with delimiter "\n"
% f; }7 P6 A& b' H( \! o        set load type to A_tote
- W) T( |- J, `- g        if A_tote="tote 1" then set A_induct to 1
$ d5 j! V6 t" b/ k# A        else if A_tote="tote 2" then set A_induct to 20 k3 M  H" r9 L+ W) l  ^
            else set A_induct to 3   
5 ^9 ~% p9 |! M9 M        set A_i to 0
0 {# t' D" M$ z0 H        clone 1 load to P_induction! l) J; a; K" c* ]) s" _: R5 U
        wait for A_time sec
' m5 f* u6 x+ v" Z7 L& |    end
% v7 g9 {- W: a0 ^) W0 ^8 Iend
1 c2 f, X% l# Y. c2 x* d2 W7 |! D+ v9 L
begin P_induction arriving) K# [/ \* F, V5 r/ h# p
    if A_induct=1 then clone 1 load to P_pick1( \- r: m. ~2 T5 K- N
    else if A_induct=2 then clone 1 load to P_pick2
# G  _0 X6 U+ Y6 z) r$ S; B! J        else clone 1 load to P_pick3, i* S  s) q, ]6 y# M$ o
end
% {% K! M' h$ m4 e3 y* Z& X, Z7 Z. F2 I. ~: [$ f
begin P_pick1 arriving% O7 o" D6 }" e! m- p& |8 R1 N$ C
    set A_i to 1
; ]' `6 I1 H8 o5 t    move into Q_induct1' ]1 n& n" g7 {% f# S, }, \
    move into pickaisle.induct1
! d  l0 I* K2 W% D( a# x    while A_i<=30 do begin; R3 o$ k/ D0 r! F1 A  M
        travel to pickaisle.con(A_i)% B2 p1 ?' n- P1 f* u" o' ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 L0 n' B6 k% Q% Q1 n8 ]* Q6 r
        else wait for 10 sec7 n/ v) z( X5 e) L3 `5 X) a8 @
        if A_i=A_leave then send to die# a* _* n, n# v% i0 D. P5 m
        else inc A_i by 1: u3 H; @+ s) u( ?' V; x7 f8 K
    end! e& z; O8 v2 Q) J- l3 A) V+ l0 W" L
end
9 c6 C- W8 w. \, {' k. c7 z3 E1 k6 q3 x# z
begin P_pick2 arriving
. Z7 I+ Y! E% u5 ^: I    set A_i to 116 c' c  C0 ^$ |8 I2 W  F
    move into Q_induct2. u/ g* q. b9 L
    move into pickaisle.induct2
. T8 E* C  X" R9 o$ ]    while A_i<=30 do begin
0 O( a* I  P9 a* ?. i7 v        travel to pickaisle.con(A_i)$ l6 f# Z5 ~: p' x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 I- m; g; l, P8 P; H' ^
        else wait for 10 sec
9 K- I; D! u8 u; E7 q# C        if A_i=A_leave then send to die! h4 O5 T: z7 S) l; X' }$ q
        else inc A_i by 1
& V/ \8 @  p% w, `    end1 L! ~* J0 u5 K5 r7 v* Y% X" e
end
, N# ?+ T9 W4 X7 X; w( o8 [4 }5 q# L4 @. r
begin P_pick3 arriving
5 E! K2 H  Y. c6 ]; T* l* \( i    set A_i to 21
0 O( I) u: M$ C# G: w) v9 ^9 Z    move into Q_induct3
# Q9 Z$ Z% i2 p    move into pickaisle.induct3
# z/ J. Z& c9 @* l2 S' t/ r4 t    while A_i<=30 do begin" ?( t( T+ R& K# }% j% E
        travel to pickaisle.con(A_i)7 s& x; N; O: s6 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 y7 T$ P* Z( R' P" H
        else wait for 10 sec
2 k$ D  _$ Z7 j. Z  l, `- X  p) \! a        if A_i=A_leave then send to die
" l# x1 E6 L1 O) P# x        else inc A_i by 1/ J8 d( Q1 a. U0 R2 {, |+ v
    end
& Y9 a+ s* Y& Yend

最佳答案

查看完整内容

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是个什么东东?
; B# d7 ^8 R- ~% j4 D/ gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! w( U5 J: R0 h
! V- D, o4 G" v1 B: e
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* v; X7 U( T8 X; v+ H% e

' P8 P' U* W+ w' a0 a# Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' j& `7 A; D% I% m1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 P, k4 {: G- q/ i" z/ b2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! M4 B: ~5 O. q2 j  q) _$ K! p3 H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 h' B/ K: n0 o9 T
begin P_induction arriving2 v* k5 A2 G" x1 z. G
    clone 1 load to P_pick(A_induct)
  A6 I( }# g& a0 m( Kend最大的系6 Q* h6 P" H8 C# B; @* u& Z

4 l# c+ ~- l7 Y8 t; u! ^- ?: dbegin P_pick arriving3 C/ |5 E8 `3 {
    set A_i to procindex * 10 + 12 X9 W8 R$ c7 V; }: \
    move into Q_induct(procindex)+ e3 k9 t7 X6 a, I$ Y
    move into pickaisle.induct(procindex)' I* f- |( r% f0 O- J* |
    /*check the type of pickaisle.induct(i), for your last problem.*/
! Y, j) t# m5 t* z' A+ V0 \: L# N# e4 f# A$ v
    while A_i<=30 do begin5 \# ^; j+ C* I0 X5 q; ?% V, W; c
        travel to pickaisle.con(A_i)& E  d. y: L6 d! E. h) ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ]( F) g* K" ]( U$ v2 Z4 S1 i        else wait for 10 sec
! @1 V8 J. `. W2 a* {; ^        if A_i=A_leave then send to die
- K2 O9 |' M2 o        else inc A_i by 1
$ ?2 \& A) x4 v* e    end9 H7 C, g3 }; [& t5 Q+ s- M8 c3 `
end# C2 L9 W4 p5 H6 A! W4 w( G

, n$ {  A/ k* ^2 V3 [, U; m其中的procindex为整形,代表当前process的序号。5 e$ h' I% r( B0 n/ M6 P# O% p
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-2-16 09:21 , Processed in 5.116684 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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