设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14113|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 y" H8 x, A& I3 Q: \% x. Q- o7 R) G% ^3 _2 r" 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中的数值,不知道会不会有什么不妥。. P: u* F5 J$ T
$ |! p+ L+ D( \9 j
begin P_read arriving  r/ d4 ]$ }$ |( g5 K, r1 @
    while 1=1 do begin" x( v; s% U2 h' K8 D
        read A_tote from "data.txt" with delimiter "\n"
2 D  Q) `$ ~: W/ `* o        read A_time from "data.txt" with delimiter "\n"3 W/ S  X4 @# R! ^3 }# v
        read A_leave from "data.txt" with delimiter "\n"* t, B! A  X9 X- r8 _; j$ `8 ~  r
        read A_picks from "data.txt" with delimiter "\n"
8 g5 V. B$ D2 O' {! R+ n# |        set load type to A_tote
. |: q: R0 z! }0 J        if A_tote="tote 1" then set A_induct to 1
  ]/ `  h( n8 |( l( ]' O/ R        else if A_tote="tote 2" then set A_induct to 2
) l5 x8 C5 A1 D+ R/ Q- A4 c            else set A_induct to 3    3 ]5 h$ ~1 F! X7 ~' z
        set A_i to 0. F' K. w5 i7 Y. r
        clone 1 load to P_induction0 Y* y/ c+ h( X4 n4 y& \3 y, b
        wait for A_time sec4 n# Z9 ]: V( ?- }& f& Z
    end
  N% o( b2 W0 q$ o' Zend9 t7 d: K" b- d3 _
" S, m' \( i% w* O! R7 Y# C
begin P_induction arriving. W! S2 v: Q4 y% k& [' I
    if A_induct=1 then clone 1 load to P_pick1
8 p. a. i8 n' K! L1 u) O9 y2 o    else if A_induct=2 then clone 1 load to P_pick2( w2 v1 b& o2 @& o, |2 }
        else clone 1 load to P_pick3
! G+ H; O4 g6 c8 ^end
# P4 H7 B/ Y$ J. J7 b
0 N7 w6 t$ W+ I* Pbegin P_pick1 arriving  a& N7 `; t8 W7 c& F# T: w
    set A_i to 1
+ [# q4 w: ]! [  p    move into Q_induct1/ p3 ~# d7 E  K8 q" W
    move into pickaisle.induct1+ U" m# w7 w. t  \
    while A_i<=30 do begin
  k' l2 x6 u2 y: S4 ~7 D- v        travel to pickaisle.con(A_i)
6 W6 W1 ]& v2 }  m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* Q* k* K% _7 T) ?* X+ c        else wait for 10 sec0 {6 u" F8 W/ k" l8 R
        if A_i=A_leave then send to die& |& T+ }% k8 X: k2 i. }( |
        else inc A_i by 1
8 o# G. V0 B. a/ b: W    end
" r# {$ G3 V5 d& x- kend
  r( G7 N0 E# X- L
" P' z4 D" k5 H" D3 c( ]begin P_pick2 arriving. s( A0 H) E% ?% c) l5 B
    set A_i to 11
1 B( a6 L( q8 ?( ~" P4 F. ]    move into Q_induct28 k6 {2 L, ~1 a6 J3 u" y
    move into pickaisle.induct26 @0 D% W1 {# _  G7 M
    while A_i<=30 do begin* n+ t( _6 l$ p! v0 K
        travel to pickaisle.con(A_i)% j( u. n4 m( q- [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ L! ?: y, n7 W2 H* Q6 s        else wait for 10 sec
  Q, f: T+ O3 e7 e. f        if A_i=A_leave then send to die
1 [" M; D  B' W5 [; [! |; B        else inc A_i by 1. G! g1 Y' n  X  l: u0 |' r
    end
- ?2 ]2 M5 e3 W; qend
4 W- |. M, q7 |2 ^9 g* T0 P
3 {4 {7 k  m2 W% q  Bbegin P_pick3 arriving7 k9 o+ y' z$ {
    set A_i to 21$ ?# w' Z$ @$ W2 M( `/ S, p
    move into Q_induct3; e4 T; n, O, ?" A" n4 P; E
    move into pickaisle.induct3) T4 f5 E( b! L  p4 E& g
    while A_i<=30 do begin( c9 b: ~; N; E- B" d8 q9 @; f5 A
        travel to pickaisle.con(A_i)
3 W! N7 ?+ {& f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, _; L: A* k3 I; f8 s! N% ]        else wait for 10 sec# y$ p* [$ o3 o- N
        if A_i=A_leave then send to die2 K* Q! a" l/ ?- c
        else inc A_i by 15 E- e1 d3 C8 p, T
    end9 m+ v$ _  _4 K7 I! l( C
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是个什么东东?
3 h6 p* n4 s# c) F- I- }1 y7 kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* X& k8 ]' ^" |! O' B7 e2 A
' z9 ^; j( k6 jAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( X5 H1 U3 t& s
" n* f/ K* }  b( x' f* K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; h0 W( e, W, N4 R# G/ M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& K9 }) U6 _6 j
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; l" X3 f, _9 ]5 M/ t3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ }+ c( i- J. K( y; I; B/ ]! M9 Vbegin P_induction arriving
. s/ P5 |) m- g8 I& b7 Y6 C7 v7 M    clone 1 load to P_pick(A_induct)
# f8 ]1 s( V5 C# T' |! Uend最大的系
" r+ `1 o9 l- O; w" L' \
4 J- k% C1 y. n6 P+ k% Zbegin P_pick arriving0 K0 X/ p- P$ Y  A' K# @1 _
    set A_i to procindex * 10 + 1: L  ~3 P9 \/ F9 v$ l8 i
    move into Q_induct(procindex)
, t, A+ U1 n: S6 X: w5 J: {* S' Y    move into pickaisle.induct(procindex)
' D. c/ v$ h1 I* M# C    /*check the type of pickaisle.induct(i), for your last problem.*/
: T( X' e% q6 g* x% v+ t) h& p2 z. \
    while A_i<=30 do begin
4 M& \: F! S( ^: I' q# o2 z* `: C/ F        travel to pickaisle.con(A_i)' R6 D/ U8 E6 p$ e, A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  H2 D  }# v" F* f2 R. @
        else wait for 10 sec
; K2 ]' e9 Z) T# k: U2 |        if A_i=A_leave then send to die4 e8 D7 a2 J# E* z# o  S
        else inc A_i by 11 w! d" s/ C- l4 F0 a
    end
( R# n. S. ^) @end
  A1 A# ^: C) c9 ~) l4 t( i$ u* y! M$ X$ H* A
其中的procindex为整形,代表当前process的序号。5 Z8 m$ A) C2 h! D
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-10 02:55 , Processed in 0.016510 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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