设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12476|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  [6 e2 z: Z5 Z) _$ f+ U- |& j
' }; J6 m: h% R2 D( e/ ?3 t7 ^# Y1 n: t
我的问题是,在每个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( x( O" v2 Y4 b' c8 c  [; x+ R

9 r% \3 J, [! b, D' a) Sbegin P_read arriving! m% X3 e) Q* O  g- Q2 _6 a
    while 1=1 do begin5 u& Y: x0 u: I! L7 l, T+ o
        read A_tote from "data.txt" with delimiter "\n"
. }' \; n, H. {1 K" E2 K% ?+ U3 F. h# e        read A_time from "data.txt" with delimiter "\n"+ Y, ]" ^% L8 t( U# \
        read A_leave from "data.txt" with delimiter "\n"( \4 \: d) R: x* V( S6 U
        read A_picks from "data.txt" with delimiter "\n"! {; K" v/ ^" X8 k- @: X
        set load type to A_tote1 v( w! N) `; h7 L
        if A_tote="tote 1" then set A_induct to 14 O& F& A/ S- ?  L9 x# G
        else if A_tote="tote 2" then set A_induct to 2) `" m. e0 A: ~9 F( K( g. [
            else set A_induct to 3   
3 V0 [" n) v  [1 b        set A_i to 06 o+ V4 Q9 O8 j; @
        clone 1 load to P_induction4 O) m5 C# \# J+ S4 l
        wait for A_time sec* O  _9 f  M4 m- v2 G
    end
6 y* P2 j! S0 q3 k2 M: Zend3 l! a, ]% i$ r( U* h' a

% e) [% v( i7 m3 H2 _begin P_induction arriving
! r& \  y  c9 Z, P( q# ^# b7 e( \: s    if A_induct=1 then clone 1 load to P_pick1
) d8 J0 b' d1 {  E- ~    else if A_induct=2 then clone 1 load to P_pick2
# n. i0 M  n0 ^9 z1 o        else clone 1 load to P_pick3
5 N1 [% V1 _# |end1 T+ w$ r0 _* L

& l; G. B: w3 n" G9 P1 \$ Hbegin P_pick1 arriving
- D9 ^/ u: a5 B7 f3 _& a    set A_i to 1
- [6 F/ X$ \2 s( ]1 Q( v    move into Q_induct1- w% z1 F2 a, r% `& W
    move into pickaisle.induct12 _0 R  a4 F3 R; T
    while A_i<=30 do begin3 i+ U( L8 N, X; T% w: @7 |3 T; N
        travel to pickaisle.con(A_i)) Q( L# Z" P" h% C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 d% N8 @* ]/ \4 w# m
        else wait for 10 sec8 P+ w0 S" w$ y
        if A_i=A_leave then send to die' X9 G; v3 ?' j: l! X, N
        else inc A_i by 1/ Z& f/ _9 y; b9 n4 O, R7 J- b
    end) W8 o8 i& ^7 _8 j% m. D3 K1 z
end8 k9 D. a2 n- o$ t6 e- u; G
5 g+ J) H8 }! u
begin P_pick2 arriving& a  ~2 m& f. E0 v$ M
    set A_i to 11
" @/ w  M& U  @1 \9 m( X$ n4 [! i    move into Q_induct2
) l$ a' q+ K' ]( L% k    move into pickaisle.induct2, c/ C! l5 w- d; v% s5 I2 [0 }
    while A_i<=30 do begin
" O- o& D9 b6 H        travel to pickaisle.con(A_i)+ \6 ~, H  W5 e( R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  j+ z( {' ^( W3 W% T
        else wait for 10 sec& P- p3 q5 }/ A" R, |
        if A_i=A_leave then send to die& f9 \7 D- m) s+ q
        else inc A_i by 13 f6 h, l+ Q/ ~) i' ~" n9 \: [$ }
    end
2 i& h6 W& Z6 r; nend( b8 W- t; r; z. s+ t
+ _" k+ S3 J1 p2 F1 C. n7 K
begin P_pick3 arriving
* Y, Y' d0 f. s! E    set A_i to 21- t' ]/ P/ Q9 x1 A  j# u
    move into Q_induct3
  m4 B5 H2 l' }5 \* `    move into pickaisle.induct3
9 |% O; H. \$ l    while A_i<=30 do begin1 J! w: i1 m4 E
        travel to pickaisle.con(A_i)' o; Q6 \0 ]$ p; ], r" c% @: Y8 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: U, j+ r7 d( X/ S, I8 g4 J, J5 G
        else wait for 10 sec
+ V( N* }# l: I/ E0 p9 }% l        if A_i=A_leave then send to die9 N: m4 p+ `: {; q+ z1 O( Q- u8 t
        else inc A_i by 1
( i( H5 X# [) l* N2 n$ Y    end2 ^4 g/ e, O( A' u
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是个什么东东?) \0 ?) }# A  E  ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" K1 m" L3 h; v

' ~& C0 V+ ?) m& y* H6 BAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. G) N! _& h, ~8 H+ F" i8 h0 E0 {

) u- @" {+ \1 v& m  e) h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 v. K& E4 @7 |! K& I  [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. W9 h) M1 G- N, t6 O  E2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ q8 y' X4 }3 h! F8 M7 I, v
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 \+ `- T* n" i- Z; K- D6 @
begin P_induction arriving; C0 o2 R" n* v) P. p% s# A: F: H
    clone 1 load to P_pick(A_induct)
2 d2 E5 g( j) kend最大的系
9 k- a* a" g8 x; K) s, J
, Q( \4 T- J/ I+ u# Fbegin P_pick arriving
* d# B3 _- m' l$ U- t6 c    set A_i to procindex * 10 + 1
  M* ~, X* ?( }( P0 E+ v) B    move into Q_induct(procindex)
; T' O3 ^* q2 U: N1 T    move into pickaisle.induct(procindex)$ C6 F$ p+ R# k& W
    /*check the type of pickaisle.induct(i), for your last problem.*/9 L) K) N& _: x

1 |" Z" c$ q8 q$ n    while A_i<=30 do begin
2 Q. o( V# Z1 s$ @, j2 ^$ w        travel to pickaisle.con(A_i)2 q% w. ^$ T( ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" \: |6 k; a5 w9 R* @        else wait for 10 sec! H9 M, I2 y& z* ~4 S
        if A_i=A_leave then send to die( t& _9 Z' A. Y. I
        else inc A_i by 1
5 V+ V1 F* j" r3 D5 n    end* C1 i; I4 h9 w7 Q( D, {4 N) h
end
7 q$ I8 N1 `+ l
% m7 b0 i* d+ z! {. [1 }其中的procindex为整形,代表当前process的序号。
/ U( V. s* u* K7 f" p! \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-1-27 06:37 , Processed in 0.023709 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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