设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13368|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 u' s9 {% R1 {! \  o# Z

* w8 ^" G1 T( ^' z( E3 o+ e3 }我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 L) q, X( h* d
  m5 n$ c( H7 P. G! a  S5 \begin P_read arriving
" S" K& ~. L4 {9 J) C( t8 E" I# W    while 1=1 do begin1 }: Y1 F" _% U" v9 D2 F4 I6 u
        read A_tote from "data.txt" with delimiter "\n"
1 q7 }9 V) s6 O$ f; p# a        read A_time from "data.txt" with delimiter "\n"
2 z" M. j  W8 t        read A_leave from "data.txt" with delimiter "\n"
* X: u# `6 m" z" G$ m3 F2 S0 T        read A_picks from "data.txt" with delimiter "\n"
# m2 c( M% V$ z0 i        set load type to A_tote
+ n4 b, F/ K; y* d! d        if A_tote="tote 1" then set A_induct to 1
6 |8 ]/ l7 q# S' }  u& a        else if A_tote="tote 2" then set A_induct to 2) H8 @. \# P2 [3 k( u/ I
            else set A_induct to 3   
" |% T! n5 V% G( y) i7 ~0 C        set A_i to 0
" \: j3 U0 `( w5 ?( m- y        clone 1 load to P_induction" d$ b6 G- O/ o% F3 Y
        wait for A_time sec+ h" n# x3 ~; H- J4 ?% H! K  M
    end  E; B5 s6 c6 s" ?
end
* T6 @: f" J6 m% N4 j/ j- b+ ?5 j/ l) H7 D* A
begin P_induction arriving
" u9 V9 @% g5 Q( Y/ W' w    if A_induct=1 then clone 1 load to P_pick1
* f7 W. \* k  M! `; D    else if A_induct=2 then clone 1 load to P_pick2" n2 O; ?! g7 Q4 {+ [
        else clone 1 load to P_pick3, x2 J+ V0 ?; I4 p
end
7 T# a& Z% s* _0 L: D& c- k, g2 i5 E2 |) L. m4 k0 g
begin P_pick1 arriving
9 T/ V( R9 k3 B% g    set A_i to 1
8 Q4 k7 z! y) ?2 R& q, [    move into Q_induct1* c  {( j; y' U' s! }
    move into pickaisle.induct1
6 g% B' E3 p, r& @" S* }6 O: A  Q    while A_i<=30 do begin. K2 }" Q0 y+ k" C4 p. T
        travel to pickaisle.con(A_i)
5 b& {! ?' r5 v) e" \" @" B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) j1 y; H5 {: @2 h        else wait for 10 sec
, l# f6 e3 z5 r7 T+ r0 J, r        if A_i=A_leave then send to die
7 g8 Z* M5 g  V' T, w! U0 _' h        else inc A_i by 1
% F4 l1 t0 U. H, f4 l    end
2 o! n! u9 x) d8 t2 ?end( S' d0 k+ r9 }$ f3 x7 M0 D

( e0 R* J# B; l! I: H8 ?9 i8 w, K6 Abegin P_pick2 arriving
) V3 J# Y9 c5 b2 T    set A_i to 11
+ E' H; K! t) K    move into Q_induct2+ K) V- a; |) m( D0 B3 w% E
    move into pickaisle.induct2
6 ^# j" s# W  B; [* c, |    while A_i<=30 do begin
' B  w. R3 h, ]- O% b6 M        travel to pickaisle.con(A_i)
8 B5 A' T0 T5 p4 g* [1 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 N! C3 q6 S" j1 A7 |
        else wait for 10 sec
; \6 Y( N+ @3 C1 v/ P& ]        if A_i=A_leave then send to die
$ h3 q& z/ `1 z4 ?% o        else inc A_i by 10 C9 h3 c  V* u$ {) y4 Z# n; ]0 d
    end
) ?, l, U. b/ c6 ^% |end
! |4 L7 ^# V: g1 U& U9 @' `, b9 x1 J& I+ b; K
begin P_pick3 arriving
- Y/ F+ ]2 J5 @/ O, z* ], @    set A_i to 218 g% N1 I& v5 f6 e
    move into Q_induct3. o( M9 n7 ~  P) i+ W; |5 p
    move into pickaisle.induct3
/ b; M" J: Y5 y) ?    while A_i<=30 do begin
$ D$ R+ h+ A' {8 V        travel to pickaisle.con(A_i)
- G% y* z# N- b* b0 v0 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ X; d+ s5 A2 {, F. C& K        else wait for 10 sec
, p/ X" j, [# A4 L        if A_i=A_leave then send to die2 W6 d$ V% U% T2 ^+ o+ Z3 L
        else inc A_i by 1+ l- ~% Z8 q! e, n/ x/ [/ ^
    end
( B9 W" G- u' ~3 ^: c2 Nend

最佳答案

查看完整内容

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是个什么东东?
& O+ ?. g7 E+ W" Y- ]7 z5 M: }move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- G  q2 B+ h, Y, W, |' F$ a
7 S& c) G6 A' ]9 D4 O1 j
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ Z& d  B; @! w3 u: J0 ?5 }0 y4 W9 r6 r+ u- J! o$ U, D- V
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 v3 P4 Y, k$ u8 m: I$ n4 W
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 D  {4 g! x. _# p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ w' L8 y; |8 a0 a+ l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ J4 `" A; |1 N) Z* Fbegin P_induction arriving
; J' t! y0 x% _. J/ `5 ]. i    clone 1 load to P_pick(A_induct)
2 C( \/ R. _/ @  {" v' Z4 A2 t& t' pend最大的系
, a# g* B. A( |6 s% F" D1 x2 ?/ B9 f# v7 x
begin P_pick arriving( h5 W) b0 H. w- f+ K% W1 J! s
    set A_i to procindex * 10 + 1& e) ~0 `' I- S; X' o) X7 x# ~' o
    move into Q_induct(procindex)
. D9 Z0 f; U4 w% |& ~" u, i" X    move into pickaisle.induct(procindex)
' I) \" Y$ x5 q/ o& Y' U2 G    /*check the type of pickaisle.induct(i), for your last problem.*/+ s5 G* Q/ {$ E2 a' n

$ v3 s3 i1 |& m5 E/ F    while A_i<=30 do begin: M9 Y" J1 z0 U4 X3 }- S
        travel to pickaisle.con(A_i)
6 p9 e/ X: }/ o* B! ~# V( `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 o* b/ j9 p0 q* u. F+ e$ T1 ~
        else wait for 10 sec7 T1 t( T" N# D7 ^% i& V, m
        if A_i=A_leave then send to die4 p' c+ O7 V- w0 g( u4 X
        else inc A_i by 1- K+ P  @: d. S! t$ i, k
    end( p! h; H/ q! U2 j- ~$ L
end
3 V/ n# C# V+ f9 H
& o0 V& Y3 k4 j6 a5 j; j% S其中的procindex为整形,代表当前process的序号。
. J: K2 w5 i2 w  mstation和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-4-7 08:55 , Processed in 0.018365 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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