设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14729|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 n  m# `( m1 i7 H" Q6 \, }7 x% d
$ U+ s, t! C( m+ z/ _& z
我的问题是,在每个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. |& m# C3 _+ t* ~+ X+ g8 |# d, S5 X6 ^
begin P_read arriving
6 Y0 F+ ~5 a6 l* W  W2 j  @    while 1=1 do begin# H! X6 U, T  t2 j' m( ^
        read A_tote from "data.txt" with delimiter "\n"
+ x6 G! x3 p/ I  ^        read A_time from "data.txt" with delimiter "\n"  a) m( v1 ?" c6 n0 T
        read A_leave from "data.txt" with delimiter "\n"
  |  |4 R( _1 W8 h0 ~/ r        read A_picks from "data.txt" with delimiter "\n": H( J2 m9 ~& U8 ~8 S
        set load type to A_tote/ c! C- c# V( v5 l0 w: V1 P) V
        if A_tote="tote 1" then set A_induct to 19 S! D# E. r& [
        else if A_tote="tote 2" then set A_induct to 2' l$ N5 F9 r% @
            else set A_induct to 3    " b! z3 a( z. E/ P* t! R
        set A_i to 0
  e: D8 F; S: w. K& Q1 f        clone 1 load to P_induction
( r- U( [1 ?- U: I; p# q        wait for A_time sec. J. x! E+ B0 t( y5 R; A
    end
% N" ]3 u5 i  Yend
  l( t7 g2 r1 _4 s
0 j. k2 t3 {  F+ H' b/ r' ~" g7 @1 qbegin P_induction arriving
( h( R# K0 i: H, N0 T    if A_induct=1 then clone 1 load to P_pick1
6 m9 d! v7 \4 Z    else if A_induct=2 then clone 1 load to P_pick21 R- M/ m3 C) n& L( S
        else clone 1 load to P_pick33 O( y' Y5 \! b
end
( v3 M( S8 K. |, O0 y) H) _. W3 |2 n: Z4 a5 _
begin P_pick1 arriving
5 r8 D( d4 H  G9 c& J" R5 r1 h    set A_i to 1+ L- m/ u/ N) P" Y8 f' ~
    move into Q_induct1
0 @* e! p! @: U* j( e/ ^    move into pickaisle.induct1- K, [( b9 l/ E, {" b
    while A_i<=30 do begin2 X- X3 a& m4 e/ @; x5 S
        travel to pickaisle.con(A_i)
# J* `. h& H  u/ o9 c& c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ]; W: R# W  [, r1 _
        else wait for 10 sec5 ^2 C2 n: G2 Z7 W* v2 z2 ~
        if A_i=A_leave then send to die
. `: ^  j! C* ?9 j! b# V# D1 v' D        else inc A_i by 1
) H# H4 |6 s8 A" @, s& x    end
: e  k+ f% m3 yend
; o. m4 R* z/ U- f4 v3 K
  D$ K  e' {: c4 obegin P_pick2 arriving" }2 E4 R" E2 ?& G* d! Z
    set A_i to 11- L- |( a" A& t! p6 I- i
    move into Q_induct2
- y0 |1 e( I) g) s    move into pickaisle.induct28 R+ H+ ]4 a: G7 X+ I; E
    while A_i<=30 do begin
# S) N# N4 j" K; P        travel to pickaisle.con(A_i)
% I6 h! [9 J# Y. R# f& Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( }2 b! R' x9 U( a& X        else wait for 10 sec
9 M, a( n4 ^- x, B9 F/ R        if A_i=A_leave then send to die$ q2 {5 {( G2 G7 e
        else inc A_i by 1
1 r/ a& f& |2 c- ]/ P7 _    end8 O9 u. {! ?( I' I( g* W, ?) U
end
7 }8 s1 J' K  a1 M3 y2 Y* w& V$ A7 I$ t0 T7 R
begin P_pick3 arriving: |: {3 x7 P5 b2 e0 V. P7 I
    set A_i to 21. m9 R* Y0 |- ], N8 e
    move into Q_induct38 ]/ s3 ?8 [3 X$ A( @
    move into pickaisle.induct32 }  W3 E/ l6 P2 h7 l; g8 n. b# |
    while A_i<=30 do begin7 Q! M0 B$ B( q) C5 c8 H" g2 B% r+ w
        travel to pickaisle.con(A_i)1 F2 i; _: X3 W2 O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ b. E0 }$ y% w( r* g
        else wait for 10 sec
) [6 a9 H& P( h7 e6 R        if A_i=A_leave then send to die8 B0 c& r1 T$ b2 h7 k4 I5 c
        else inc A_i by 1
; I* _$ _% p7 r8 x1 e6 F) i! ?    end
+ G3 B# y) D3 A) xend

最佳答案

查看完整内容

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是个什么东东?
( m  U9 q/ C  Z( P1 s: G" {; Hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  U* @) x% P! u! |5 A

, i3 Y& I( G6 SAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' V1 k9 r, M* R7 Q# B# [! s7 r0 k8 o) g; J
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 w" V" b0 k+ c3 D( |# I1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 |- _8 z4 S+ T# q3 Y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 b6 z8 [  i  I4 y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 j* t6 j" ^( S' Gbegin P_induction arriving
# ~' u* r4 [, K  w0 `    clone 1 load to P_pick(A_induct)
) y& D1 E6 N8 F' Oend最大的系: Q' U' ?9 o2 s8 H9 d
8 n, E# g: Q, g, r1 l
begin P_pick arriving
. p0 z( z, T$ K1 o    set A_i to procindex * 10 + 1
9 W% |6 z9 @6 d3 r* o    move into Q_induct(procindex)
6 j* ]6 ~" G' l5 ~" K    move into pickaisle.induct(procindex)* j( O) t1 H8 W1 _0 Y5 H( p
    /*check the type of pickaisle.induct(i), for your last problem.*/+ Q: o9 [1 U7 o4 f$ a' n

* @- I8 C* i" Q( r$ O1 j  a    while A_i<=30 do begin
& N; s# u5 x# w# h7 _- [        travel to pickaisle.con(A_i)8 M1 q: K9 D/ k2 E+ F# X3 m+ z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& J  _/ t; U3 B+ {/ R        else wait for 10 sec. M' S9 Q2 m+ ^4 S/ L
        if A_i=A_leave then send to die* B" {' n0 C& q
        else inc A_i by 18 C+ }0 e0 N9 X' N
    end
# u4 f$ I6 |$ s0 D5 Vend
! X" h7 k- l/ m! |$ V5 G2 S! g# G; Q) I+ ^
其中的procindex为整形,代表当前process的序号。
4 V. j- f1 \. H& x+ bstation和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-23 21:41 , Processed in 0.015496 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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