设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11711|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ p( }6 N8 C* M- v0 W, o  K2 r9 l5 V) d
, a$ A3 [1 C. m# {* t5 u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: Y9 G& w/ J* z
3 k# L. F* U! l2 \begin P_read arriving
* J7 u3 o. p2 ]+ J1 y, e) W  }6 _! G    while 1=1 do begin
% f8 x' A% N" r        read A_tote from "data.txt" with delimiter "\n"
5 v! U, G7 @9 b9 X5 A+ A- z1 `+ p        read A_time from "data.txt" with delimiter "\n"
$ S& ~% q3 O) u) Z  u        read A_leave from "data.txt" with delimiter "\n"
- V7 Q+ w/ M1 s; _        read A_picks from "data.txt" with delimiter "\n"
' [3 a# H3 k& a* Y        set load type to A_tote1 J/ G( b; I5 ]1 y
        if A_tote="tote 1" then set A_induct to 1* Z) }, a/ G. [1 @0 T
        else if A_tote="tote 2" then set A_induct to 2$ O9 d# i- I- e: {/ r
            else set A_induct to 3    6 A0 ]% ]. L4 H' g; a6 M+ B. R. \
        set A_i to 0. m: _" L! c: M% J1 o
        clone 1 load to P_induction
; Q1 w" [1 N' e        wait for A_time sec
3 v  N/ F+ ^+ G. z8 q  k# Y+ [    end
; g' Z, m/ I* L! I+ ?+ @( r0 x. Oend
/ E0 I7 l+ d# ~, a1 \$ z
. ?7 h1 p9 U& L+ ^% \$ o, Mbegin P_induction arriving
6 h# A) S( I& ~$ c8 _$ d5 K    if A_induct=1 then clone 1 load to P_pick1
1 {6 y, `$ w, x- i' Q2 ?    else if A_induct=2 then clone 1 load to P_pick2
. i- ]  N: h, H( L        else clone 1 load to P_pick3* i5 g+ Q7 ^* j& v, d; V( Z
end. f  i% p! R  }2 {4 \# h
/ P( v; p5 ^/ M
begin P_pick1 arriving0 F) [# O: J, H# q+ x( _" n$ S
    set A_i to 1
1 t1 f6 O8 U2 I2 d- D9 t    move into Q_induct1  ]# L: N7 ^1 f7 K/ s
    move into pickaisle.induct1( }1 D3 @. L) N. ~0 o% B
    while A_i<=30 do begin) m/ d) H7 D" ]' `$ k: x
        travel to pickaisle.con(A_i)
0 U: q' L2 I9 }6 N) W9 w, J8 W1 G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 J: J2 S: f7 n7 B! E: W        else wait for 10 sec
- \5 o0 V) N) u( q' Q# W        if A_i=A_leave then send to die/ J! G; b/ s# P: n* \1 i
        else inc A_i by 11 f3 ?& I3 ]- @
    end
2 i" K& J9 J2 s# H7 zend( k4 `+ L$ p- O1 M& p3 J* K
' D! Q+ ^3 T5 g+ O* i$ V
begin P_pick2 arriving
1 c' C3 @" U9 A" {    set A_i to 11
; Q- I! n3 E5 ~5 K1 r5 G7 B5 V    move into Q_induct29 w& q. r  @( i$ p  T
    move into pickaisle.induct2
: s& s& x. O- X* ?    while A_i<=30 do begin' I: c& b  v3 E/ c9 {
        travel to pickaisle.con(A_i)7 p) N( Z7 d/ I3 ?; N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" G! E( V, s' \! B+ O
        else wait for 10 sec
1 {0 G7 }7 w6 @# Q        if A_i=A_leave then send to die2 A7 ]* `- U% l. r4 E8 t
        else inc A_i by 1( R, i% F3 {" r
    end% P5 E  H; t, V- k
end
7 \1 h; Z/ T$ b  C& c4 U, P" F
9 k( I  O0 H( e- R( a3 v& K: j  ^begin P_pick3 arriving
/ Q9 [, I! h, h# v; E: T6 L    set A_i to 21+ v; b, w9 B3 L; k5 z
    move into Q_induct3. f" M( A; P9 I4 V: P6 {" [) {$ S
    move into pickaisle.induct3
9 h4 t" G+ B2 t; C  z& M! _    while A_i<=30 do begin- S, n6 B8 u9 L3 g3 g( T% \
        travel to pickaisle.con(A_i)9 u/ ]4 |, w! J+ g2 i. j  h4 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 j8 d1 _+ p* J: B2 l
        else wait for 10 sec
1 a2 e0 m; p1 |% b- L        if A_i=A_leave then send to die
, b* i* q1 L3 n9 G        else inc A_i by 1) z. u# N% z$ ^, |. @( d; o
    end
0 X1 O& e- |4 T5 q3 D9 _1 [, Q% l, \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是个什么东东?
7 t5 s" L0 U: ~5 Umove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! Y3 m% }. k  X# ^3 v/ s4 c% s& w7 {2 p- x$ h5 \8 E7 K+ l) T+ ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! h: h1 m: U0 l6 E7 s( }
  V+ s: F8 j- S( N( ^
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 |6 t) K7 f1 U3 f# B1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ C) Q) @4 o8 F% Z0 [9 W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 e6 F5 n& Z% C3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 [3 H7 M  R( L
begin P_induction arriving2 w! t2 m% H; ]4 T
    clone 1 load to P_pick(A_induct)
  {( R) w0 m' K8 uend最大的系
- h! r; ~! M; u6 ^$ P, a  l
% ^" |- Z' {/ Zbegin P_pick arriving
, w. H# F4 g0 K2 E3 i! w/ R* d    set A_i to procindex * 10 + 17 B" K- |1 ^. s; j5 u- e0 U5 [  G
    move into Q_induct(procindex)0 B+ w& {' L2 S) G+ A
    move into pickaisle.induct(procindex)
# \( h; |5 X) ]9 o/ B. \    /*check the type of pickaisle.induct(i), for your last problem.*/
9 t. W% l* m' Q2 c, ]* G7 f" {2 O" G
: q, I, Y% R& x/ A  A    while A_i<=30 do begin# o0 g3 Z* M, V+ N6 K1 y4 s, U7 Q& E
        travel to pickaisle.con(A_i)
& B9 \7 f9 J' d7 j6 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 d5 ^1 I- n7 s: L        else wait for 10 sec
3 C7 A; T7 s+ y" l, o6 {* L5 L        if A_i=A_leave then send to die! ~6 L* d& q$ o; j2 p7 B
        else inc A_i by 16 O: r6 F! `- e6 G, L8 I! K" ?
    end
# |& |5 E9 l! S& ^end$ O1 ^: y/ D4 }5 i3 K) Q, C: e' t

& s5 P, m, `' p% X1 x: j其中的procindex为整形,代表当前process的序号。
) r* B  E8 C0 ~& `+ @: xstation和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, 2025-11-29 02:15 , Processed in 0.046688 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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