设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13052|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& b( |# w6 ~! K* m  V' I+ f; x$ ^/ u$ n: w% K6 w3 r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 O7 W5 C8 u$ ^6 P0 {5 S5 q  Q, G3 e' r
begin P_read arriving& ~& e- r" C2 w& C& R. k$ ?
    while 1=1 do begin4 L2 h" \/ P8 m( S: ~  a" s
        read A_tote from "data.txt" with delimiter "\n"1 w) w) _. G5 P  @6 c  m
        read A_time from "data.txt" with delimiter "\n"
2 h1 y4 {1 X+ v        read A_leave from "data.txt" with delimiter "\n"2 z& a5 R, d! X& L. `
        read A_picks from "data.txt" with delimiter "\n"3 V0 N: P+ E: J: s4 W
        set load type to A_tote3 U: |" U9 Y& x5 l5 [5 _
        if A_tote="tote 1" then set A_induct to 1
  c0 \: i4 C7 @3 F( k        else if A_tote="tote 2" then set A_induct to 2
% l9 W& Z- g0 e( w& x2 u            else set A_induct to 3    + X# ^! ]3 m1 B1 D9 v( d
        set A_i to 0/ u! U4 d6 ^& \; G' T' p
        clone 1 load to P_induction4 Y5 n/ I7 g( l: v& |' V
        wait for A_time sec
- b1 O* q; r  b. ]7 }6 o/ u    end
3 g6 a& c* \3 T2 x7 x: |; `; Hend1 U7 j7 f6 S( w% {4 t7 W* j

1 e. t; e. }1 q0 tbegin P_induction arriving
  R8 G0 O2 [* {    if A_induct=1 then clone 1 load to P_pick1
* u% j4 S5 l6 i4 U1 J    else if A_induct=2 then clone 1 load to P_pick2
4 C& M: L5 {2 Y1 A9 r        else clone 1 load to P_pick3
7 B5 F, H2 J8 i1 O) T) h4 m' Wend7 \3 T3 q* x$ X; B
& T, K, g# r" g
begin P_pick1 arriving
4 g: E: j& U" L$ G! G' m1 C    set A_i to 1  z, v8 {5 S; l4 S  Y  p- M' O& m
    move into Q_induct1. O3 G/ u7 s; w- d
    move into pickaisle.induct1
! F1 C& G: B/ g    while A_i<=30 do begin
3 s. l( f1 x6 |' P5 S' t. U        travel to pickaisle.con(A_i)
2 w  O% m1 l% t+ q! g# Q5 W8 p& x6 j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 ^+ d3 D. X" W- N+ b        else wait for 10 sec
$ S. y1 V5 T3 }  H! \3 }        if A_i=A_leave then send to die
& P% g6 f+ {' _: @0 N' k        else inc A_i by 1
. ^6 V/ n4 {! Z% g    end
6 B- k/ I; T5 E' B+ e$ jend" ~: |& _' X! ~' ^; A, @& F

. B2 u3 x- I+ V& nbegin P_pick2 arriving
8 U  |/ d4 D; ?# x' n    set A_i to 11
# @7 ~# i0 \$ [0 e8 G) D. b    move into Q_induct23 ]9 a" h1 {! l! f: H6 l2 d7 k6 H( K0 z
    move into pickaisle.induct2  U: S$ ?3 j5 J0 `* w
    while A_i<=30 do begin
( R/ J1 p+ h' @' F/ _        travel to pickaisle.con(A_i)
# r7 P) [4 _" \9 N. B/ M        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 }: A) P" D: E/ u2 W+ G
        else wait for 10 sec
8 e! A( Z' j# u! u        if A_i=A_leave then send to die, f+ U1 M9 ~2 c  H5 [
        else inc A_i by 1  i/ f' \! p1 }  O# e
    end
1 g: B1 o2 p0 x& vend1 _4 t8 C* G6 [6 X$ R

8 h6 w$ _4 H, M4 \8 |begin P_pick3 arriving
% ~; x8 _7 |% ^' T5 M    set A_i to 21
7 [* R6 e8 C6 f/ n8 x    move into Q_induct3
) V: p0 j& Q  P( c    move into pickaisle.induct3
7 b/ C) M4 G; h. s3 s$ G    while A_i<=30 do begin
! q5 {3 g0 m8 N1 ~3 k% I1 K' h        travel to pickaisle.con(A_i)/ e: h8 E% f& Q1 J  Z0 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' e8 d& }5 F' ?. F5 n) \        else wait for 10 sec) s$ A( a# |' l% Y
        if A_i=A_leave then send to die
3 X! C( q* T0 B0 `        else inc A_i by 1
) e& A4 \2 |! V2 e& C6 W    end
  v' N" ?* E  Q" }$ bend

最佳答案

查看完整内容

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是个什么东东?
& _* z/ L* A3 _0 ?9 A5 p8 `2 ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 f7 W2 A6 o4 `
5 G( |5 ]6 b7 u: y0 |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ G; V5 T+ b9 `/ N7 }8 z
3 V! j5 y9 C$ X# p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! U& f# ?: e" U- [4 y" n! R' v; x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. w, l+ n- d# D# R- u4 f) ^& E2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# r3 L$ u* Z( W  Q8 @3 m- b
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:' j/ l5 F1 Q1 j# R; L
begin P_induction arriving
( E$ D* Q$ u2 J    clone 1 load to P_pick(A_induct)
- {* ^: C( }' m/ wend最大的系
3 X! m' q9 S" ?  _
& H$ r5 w, @7 G5 ^0 j3 X* j8 N) Nbegin P_pick arriving
' u( L/ u" d) Z# g/ ?7 O. E    set A_i to procindex * 10 + 1
1 ~' p7 s5 ^, d0 R$ T- \; ]6 B5 [* J    move into Q_induct(procindex)
% r3 S: J- W* t    move into pickaisle.induct(procindex); j; C- \; \+ Y) E
    /*check the type of pickaisle.induct(i), for your last problem.*/  F- D! C  B! q4 Y/ `+ y5 Y

' D9 U6 p7 N9 v& i4 c    while A_i<=30 do begin# N# S7 w+ Z1 G& L* N% e
        travel to pickaisle.con(A_i)
* Y5 H7 I" T  o) V! ^7 G- X* C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( x! K3 v5 d/ ]- B- J& w5 `" z! V6 f        else wait for 10 sec
, \1 h! w" f$ s        if A_i=A_leave then send to die* J/ n, u" T! I% `
        else inc A_i by 1% N; I9 i+ I  h1 n
    end
$ T1 y! I4 ~; L8 eend1 E: J  E# M  _

9 P3 {7 F% C5 h/ K3 K其中的procindex为整形,代表当前process的序号。( O# h6 F9 i0 `, y
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-3-13 21:41 , Processed in 0.017503 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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