设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12379|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% |+ q* {' K2 [2 g2 c+ F- G+ n
! x1 m3 ]+ D3 L1 V' S( B: C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 ^3 H: j: Q& k3 M/ o7 `6 ]; k  S0 V. [! `! q
begin P_read arriving% |0 I" G, z4 R" Q* _& `' f
    while 1=1 do begin) w, |3 t2 K9 b
        read A_tote from "data.txt" with delimiter "\n"
- x- ]( R8 w# o( s' I        read A_time from "data.txt" with delimiter "\n"
7 r' Z; w9 t" D' v        read A_leave from "data.txt" with delimiter "\n"" K4 {0 u: }+ r/ f! ^8 Q& ^$ L0 p
        read A_picks from "data.txt" with delimiter "\n"
9 O- u/ L: N9 u! f2 G6 \        set load type to A_tote
! ~. u4 Q6 S) S        if A_tote="tote 1" then set A_induct to 1% Y% ^1 `5 N3 U  F% [
        else if A_tote="tote 2" then set A_induct to 24 L% f" `8 ^; N7 o  x  Q' g& }
            else set A_induct to 3   
3 k3 ?  X4 j2 Q) C  E, j# v        set A_i to 0
7 H  n2 A. p3 F# @2 W1 m        clone 1 load to P_induction) \: O& k5 m5 q( n, \5 Y$ i
        wait for A_time sec
$ M" T+ W! S+ _    end
- m1 T5 E, `7 x0 X+ d+ Q% y: aend
$ b* l5 q2 I/ Q' I& B% l6 H9 G" O4 F0 H1 O/ Y# `! I4 U' n1 A
begin P_induction arriving0 N& a8 E  f6 {$ Y9 |9 Q
    if A_induct=1 then clone 1 load to P_pick1* u/ I- N# a* T6 y+ I
    else if A_induct=2 then clone 1 load to P_pick2
2 C+ t; ]& }8 S# ~- r4 n4 G        else clone 1 load to P_pick3  i3 c5 B( R* [6 j+ S  h+ {
end- g$ o( n4 }2 d7 W& [2 \$ D" t

/ V6 z! W+ V& T/ |) x  ]begin P_pick1 arriving  B4 Q( f3 |) r2 i
    set A_i to 1* s( t  K- J& j
    move into Q_induct1
; V+ c8 v3 t, ?  ]/ p% b6 U; {& E    move into pickaisle.induct1
) y2 a- e4 w0 A( F/ _- ?# v0 |( D    while A_i<=30 do begin% N& |8 z1 T4 ]8 K9 o6 }, g9 h/ Z
        travel to pickaisle.con(A_i)* v; z/ L+ ?1 ]- f9 g0 E2 @9 H: D* ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: j$ C+ h$ O* F' w' g4 z, ]        else wait for 10 sec; j* V# u8 ~$ r! A/ W
        if A_i=A_leave then send to die
  A/ Y3 _$ x/ ^' q& r2 K+ P        else inc A_i by 17 u: n6 J  w( `, G2 B- X
    end  p- O& O/ |' s; I) K
end5 `& x* @6 T! A; X

3 F0 A! m" y9 E, \begin P_pick2 arriving
1 w" R) I* O& i0 x! C. C3 N$ k, r4 |    set A_i to 11
  W  G4 ~3 @  }    move into Q_induct29 Z% Y$ S1 ?' F
    move into pickaisle.induct2! c4 g# a3 u0 {/ L
    while A_i<=30 do begin
, x( M6 b8 h' Q  F5 y        travel to pickaisle.con(A_i); }  d! S  ]3 U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 {9 a7 n8 _- u1 X. s  n& g& j- z
        else wait for 10 sec" B: H5 ]! p$ Q& k, N8 g
        if A_i=A_leave then send to die# V. ?; q/ n/ O
        else inc A_i by 1
! j; H* C: g9 f, R' w) d+ i6 h; V4 H    end
1 x7 [' N. M1 g2 n$ @7 mend
5 U- y$ Y# ], N) \
, O0 Z# ?- J! v! @begin P_pick3 arriving$ ?* z4 D  Z& ~( G1 J* Y
    set A_i to 218 o1 M/ p3 P' r0 G6 p: O
    move into Q_induct36 w! |) {$ m. W
    move into pickaisle.induct3
% G) Q7 X5 c$ M7 u* N3 V, M    while A_i<=30 do begin, k, o$ P+ ~# y0 o8 m2 B; a7 g; x! u
        travel to pickaisle.con(A_i)
" E# d. D) u6 ?- k; Z  ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ G) Y' _4 N; O$ d! v, @4 A. b
        else wait for 10 sec
& \6 d; E  c$ S  \+ i        if A_i=A_leave then send to die( J: @* u0 p+ q7 a& k
        else inc A_i by 1$ N/ D: P9 E$ M3 H! Y
    end6 A* d1 G( [/ B% e
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是个什么东东?* E+ Z& N$ A' d; h
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- f, w) D1 d% k! B$ G% c3 I/ ?( d3 o* r( V  f
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 H. L: _* ^7 s* I) G7 k: w  b# K
8 ~: l! |0 G' V
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; s9 c, m# Z9 k1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, f5 Y! ?1 f, a8 t2 o2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 l8 k7 z9 Q/ p& }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 A+ E: b$ [  B
begin P_induction arriving% H! p  u# n4 x! @7 A$ i& f/ w
    clone 1 load to P_pick(A_induct)' E* J; G) q# p
end最大的系0 S% f! l& `1 {/ v

& l3 D, d- f" J# U0 \$ Qbegin P_pick arriving  ]" X+ o2 }6 x/ l$ U# Q
    set A_i to procindex * 10 + 1: F+ s# `0 a3 N  J: x
    move into Q_induct(procindex)8 l% \3 n3 E$ ^1 Q: a( g& R
    move into pickaisle.induct(procindex): Q7 D- Z( ?/ j1 {
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 E; O% a- v2 |
$ }0 \1 s/ w% P1 ?+ ~/ R! f) M    while A_i<=30 do begin
$ ^3 V* G+ B% ^; Z$ ?# p4 i  r6 z        travel to pickaisle.con(A_i), o7 Y) C7 Y$ j7 ~$ _6 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! k! v0 U$ F+ y' m7 O+ [        else wait for 10 sec& b" [0 \% M' @9 A) p! f" k
        if A_i=A_leave then send to die: e- N' O  ?8 K& y( V. Z/ n0 L
        else inc A_i by 1- B3 ?- I% ]  C! [
    end2 B' a2 {; m0 r
end- h' g7 X3 P7 |* O9 ~" I9 q4 b1 H4 [" V( }

' b) H; o. F/ P0 y# {其中的procindex为整形,代表当前process的序号。7 R+ y/ ^: T6 q
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-1-19 23:33 , Processed in 0.015659 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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