设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14166|回复: 2

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

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

3 w, M  R* [; \( N1 G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( F: M: u5 m+ S6 U& `6 B1 p% f! t' E* F+ g& x$ f
begin P_read arriving+ h5 j9 |% U( P' [( J
    while 1=1 do begin- L1 o% d. }+ l& o/ K: I4 |, p
        read A_tote from "data.txt" with delimiter "\n"
5 P% ~1 i, N0 \6 H6 E        read A_time from "data.txt" with delimiter "\n"
% ?( l) f2 \4 s# T( Y% g9 G! Q& y2 R. |        read A_leave from "data.txt" with delimiter "\n"
3 E+ r% j2 F' {  I) P% x1 G  L        read A_picks from "data.txt" with delimiter "\n"! L& @+ f2 T4 Z3 C* K; f
        set load type to A_tote( }* C+ S% F7 |# T
        if A_tote="tote 1" then set A_induct to 14 R! ]8 d; P7 X1 X& S9 H
        else if A_tote="tote 2" then set A_induct to 2
: `+ _6 V* A' z; v0 y            else set A_induct to 3   
+ S  o1 J; T0 }, V, P7 i' T9 g) Q        set A_i to 07 s# f; K0 O% S* m0 H- i' L
        clone 1 load to P_induction' D/ [  ]% o6 z" j% m& J" O
        wait for A_time sec0 g* o, R' U3 W& Q  K( a% ]% l0 h
    end
; n" Q9 x/ E! A( Nend
% r; a6 d1 b5 q; Z. E
! g, R. ?1 A: t" Q' Ibegin P_induction arriving
3 p9 G, c5 x$ M    if A_induct=1 then clone 1 load to P_pick1- g( C8 z8 j: w0 }# v# K9 _
    else if A_induct=2 then clone 1 load to P_pick2) g  P' \0 d  o8 g# r$ O
        else clone 1 load to P_pick3
, ]/ F* \3 R" ~7 }8 o" T  n9 Tend' r; [4 X# x* \9 s7 b
8 U* r' k% v$ P) I% }9 g" O
begin P_pick1 arriving
. r+ j$ I4 A0 ?7 I/ Q$ w    set A_i to 1
, L; E7 K& l6 ?2 Z7 D# i9 O# m    move into Q_induct1( ^2 A4 i' J$ f2 [+ Z! o; w: v
    move into pickaisle.induct1$ {6 J5 G. y" ^+ y  V
    while A_i<=30 do begin
! Y: n) z- i, p9 Q        travel to pickaisle.con(A_i)( e& v4 E. o  p+ B# O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 H  `- P( L$ _4 k        else wait for 10 sec
  I" |  ?9 S! U' {        if A_i=A_leave then send to die, |% y( b! }3 n9 d) H, u
        else inc A_i by 1
! c8 R( j6 x. a4 n    end
! a7 M  H! T- jend
6 c- R: P8 N# ~
$ k* U- E% [- H7 _begin P_pick2 arriving) ~, Y- E2 S+ g: v& }
    set A_i to 11
+ Z# Y  L# L5 B  p1 j6 U7 k( j    move into Q_induct2
' W" N0 J. x1 h7 X7 b    move into pickaisle.induct2& H7 z7 O3 b. J; n; p' E
    while A_i<=30 do begin
' }4 U7 f1 n/ t        travel to pickaisle.con(A_i)
2 t1 {- v8 |  |9 N7 U% V! h, L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' F- Y& d5 ~# P% F/ g9 ~        else wait for 10 sec
' p  }" ?( ]  V( y& y        if A_i=A_leave then send to die1 l/ D1 l- {, p
        else inc A_i by 1% G, A$ i* w0 m, M9 z; I) R
    end1 v# Y- N5 O+ [$ q" h9 ^
end
" `$ t( o! z4 M/ i+ M/ R+ Y0 Z! y3 o: B8 M8 S
begin P_pick3 arriving
# ^% ?+ F8 _- W# k3 p2 p6 l    set A_i to 21
  W6 _& i2 v5 Y( t5 _6 U, p% X5 @# |* W    move into Q_induct3* n' m% J/ ^# c! Z+ o* e5 o
    move into pickaisle.induct3) _0 {, e' W: s+ Q
    while A_i<=30 do begin- V9 k* s, O3 J  `* K
        travel to pickaisle.con(A_i)/ r. t7 E! O- e& i; @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 D% M4 N  t. D        else wait for 10 sec
3 r- C; M; ^/ U  S/ _        if A_i=A_leave then send to die
& V! u/ ^. s4 o/ j- X        else inc A_i by 16 `3 F9 O. w& J  U
    end) X1 [+ u+ n* T: ~
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是个什么东东?, y1 ]  S( Q! S- t
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( {: @6 K; v0 v/ x+ c% w3 }& @
, o( L( |/ g4 Q% C- V9 I+ lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" v& \, t) j  k4 @4 E0 u6 B! z; }- U  x' E) Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 l2 M2 s. V+ m  J6 O- W1 [2 I6 P$ g1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 [7 F( c5 ^* h9 w+ E- @2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 s( X# J( o8 \  s+ ]$ w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! w2 v5 K( r) ^* Z
begin P_induction arriving
" ]. r5 O! Y( ^9 f* E+ C" m. j$ ]    clone 1 load to P_pick(A_induct)
3 x' G; W. L- _: Z# T  ?' e2 jend最大的系0 h! c. w9 ?. u+ O6 r1 L

, {4 p/ l) }( o. }( C6 C( K: w7 abegin P_pick arriving
6 f* S. e8 l5 Q    set A_i to procindex * 10 + 11 H) H/ s: [* m/ F, v* [& p
    move into Q_induct(procindex)
; c* \& k; w1 e! ^    move into pickaisle.induct(procindex)
  ]+ t& m% j7 H4 T! ~0 m- C    /*check the type of pickaisle.induct(i), for your last problem.*/
  d8 a6 }, P) m6 Y
1 E! X% J; k' C  X    while A_i<=30 do begin: s2 R& {  m9 p6 Z
        travel to pickaisle.con(A_i)
2 q4 [) J( a  r5 J5 A$ X" y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" {$ b4 l0 }7 K' e. I        else wait for 10 sec! l8 j2 E9 z" ]3 `  T
        if A_i=A_leave then send to die: k+ `$ u( j3 t3 j/ M/ |9 @
        else inc A_i by 1
* I9 Q- Y7 X6 r5 l    end. }# R0 O3 v; g+ l; j
end' h1 A( |9 g1 R- H  w0 c
, i" _( D+ A  }  Q* k4 _3 W
其中的procindex为整形,代表当前process的序号。
; ?: F% Q7 `4 f( fstation和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-16 20:57 , Processed in 0.013639 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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