设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14304|回复: 2

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

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

+ T9 h  d$ }+ W我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& R2 \  C; n: z4 K9 _0 \" B5 i( q6 h' l+ n3 m
begin P_read arriving/ m+ l! O0 v# B7 D9 ]0 |* b7 `; z
    while 1=1 do begin8 t. X1 D5 C1 F! t: h+ C7 o$ `
        read A_tote from "data.txt" with delimiter "\n"
& N, h* @6 b( d$ X& m        read A_time from "data.txt" with delimiter "\n"6 Q. f; \! x8 T! F+ |
        read A_leave from "data.txt" with delimiter "\n"- t; y9 t' L+ P& \! T) K  V
        read A_picks from "data.txt" with delimiter "\n"
. |  ~1 ~# A6 u8 Y        set load type to A_tote) w$ N: N' S# d+ X
        if A_tote="tote 1" then set A_induct to 18 n) Q- n. M: l. Z. d
        else if A_tote="tote 2" then set A_induct to 2
  }& r) S! p- F& r: P            else set A_induct to 3    ; M7 Q; H3 ?  H
        set A_i to 02 s$ R' S4 g: `: c: C
        clone 1 load to P_induction
% R0 Q' C; o% H7 Z) t- g* e- V6 }        wait for A_time sec
; A" X9 \- ?) Z) v    end
$ W3 @! X- f4 i% L5 F, v! y" Rend0 o2 {2 u7 R4 I1 L. y

, O+ |3 D, h1 O+ v* o' dbegin P_induction arriving2 u' i* b! j! W8 D& B9 f
    if A_induct=1 then clone 1 load to P_pick1
& ?( ?: |+ O5 E    else if A_induct=2 then clone 1 load to P_pick2
4 D" k1 a' p; N: L3 L        else clone 1 load to P_pick3
/ t6 u& Z5 Y2 L1 u0 Q- k, S) Gend
* k6 J+ e  R* ?' Q% }: {
/ ]8 g+ f, l" @! @) |begin P_pick1 arriving* J9 O$ D/ H6 ], j
    set A_i to 1/ e; R8 E/ b# U  A
    move into Q_induct1
3 K; f  i4 G) d0 @  m+ N+ I" s    move into pickaisle.induct1
0 g) A# [$ \6 a0 I- S    while A_i<=30 do begin* ^& }" b  d. p
        travel to pickaisle.con(A_i)5 i, L0 g( M5 r: c" d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 N3 h) ^& K5 t( X8 ~6 F' i: c        else wait for 10 sec3 n2 f7 o1 W, n9 O2 t, n
        if A_i=A_leave then send to die9 k7 I3 S. c7 _) U( E
        else inc A_i by 1
* B! j, J$ `6 J4 P    end' h' f  }2 R( T2 `: F
end0 P! |+ U2 B. S
( c7 ~2 W8 C$ A
begin P_pick2 arriving
+ {- j3 w5 j3 w. A. V6 Z+ x" H    set A_i to 11
0 w; F1 c! P- |    move into Q_induct2, u' |5 @! O3 P
    move into pickaisle.induct2% K+ `$ |2 U4 M# }8 ~; [
    while A_i<=30 do begin
* T) t- h3 q- z1 ?. _0 c: V        travel to pickaisle.con(A_i)2 h  Y6 B4 J; O2 V" K2 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 [$ I% M$ V$ k        else wait for 10 sec
8 T4 |& L; }/ p) u        if A_i=A_leave then send to die
1 q' [+ l' E/ ]9 s; @. D: ^        else inc A_i by 1
8 E$ @: B7 J9 a  S0 b    end
1 p* k: w, r; Oend, [# _/ s" r4 q# }- f6 k

2 f1 X% E! T# }begin P_pick3 arriving
! {  q6 m" n! m" [; E8 c- c. X    set A_i to 219 Z8 M% ?" l+ D$ V
    move into Q_induct3+ G0 N: u. H: ?! K& t2 @
    move into pickaisle.induct3
# E) V7 Y# Y8 d" v    while A_i<=30 do begin
. j' u7 x1 T! |" w1 i        travel to pickaisle.con(A_i)
3 O# p& N. H, k1 h6 O2 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 d9 S* Z) r1 L  z9 |$ e        else wait for 10 sec
7 i2 u4 X" W3 p3 j. \: r# v        if A_i=A_leave then send to die
1 y6 x+ x* D/ o  r/ s        else inc A_i by 1
2 W: S. l+ C+ L    end
! k; c9 X# L6 n& qend

最佳答案

查看完整内容

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是个什么东东?
( p4 h/ p% O. U% J2 Y1 p4 r# a3 xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 P" R0 I& S" X$ K) B) T$ X

' c, m3 r. w- ?1 b  l: wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 i/ P4 ~, y4 {% C2 {3 z
: {3 R# A5 i8 M: n5 d& H3 p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ u& l6 ]. [8 a  D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;: ?) p/ W# z' _' M* V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
( U- h! f) u+ f) r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( O( Z4 f0 r. P9 ybegin P_induction arriving+ y7 j+ T1 P8 w$ x- f  U8 `
    clone 1 load to P_pick(A_induct)0 v( E9 O: z; ?$ s' `
end最大的系
& d, G" v5 a0 X- ?! ]# K$ m
3 L! [$ g) C- d8 z6 s+ @1 f0 |9 Q) Kbegin P_pick arriving# z$ I+ }; Z. I- O6 H- R1 D
    set A_i to procindex * 10 + 1
9 A4 f& Q+ t# d& B3 b8 u4 r    move into Q_induct(procindex)
. n8 }# l/ r( j    move into pickaisle.induct(procindex)2 t  ?9 F+ ^( Y% B2 \
    /*check the type of pickaisle.induct(i), for your last problem.*/
; ]9 K% C' c5 D; V/ B  f6 z% z9 u( e7 _/ g4 X1 t5 E( C  J( N
    while A_i<=30 do begin
) \* u! K1 G5 f& x2 w2 a/ k- y, P' D        travel to pickaisle.con(A_i)
5 }7 v( q) I0 M4 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& z3 q5 i' M' g* H        else wait for 10 sec
( \, G$ X# |1 P4 B- F. ?        if A_i=A_leave then send to die
' [( E1 J7 g/ C; I        else inc A_i by 1
6 z# p7 d" ?: Y* y+ U$ y- O/ Z. z    end
5 D" a+ r" k" R9 @8 [# \" Uend6 I+ H+ S% m. U- C! I# ?7 ^
! A( S& ]6 L! q
其中的procindex为整形,代表当前process的序号。% l# f$ p3 b9 W+ J6 d7 F1 g
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-6-30 14:41 , Processed in 0.015512 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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