设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12572|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 v0 u# H0 i  d4 y1 j/ d& R
8 k7 Q5 v' ]' B- U. F  N/ v. o' e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) c; S3 u; g3 ?! u! ~$ X' F9 w
8 d+ ?  m8 Q# h9 i+ q3 S% t5 \" lbegin P_read arriving
; w. A8 C* M5 t! p    while 1=1 do begin7 w' b, U$ Y: a4 l
        read A_tote from "data.txt" with delimiter "\n"
3 b: l9 V. z" h        read A_time from "data.txt" with delimiter "\n"
5 E6 w) F! J, T7 H        read A_leave from "data.txt" with delimiter "\n"
8 G7 i+ n4 G% g0 T' ?" j. I9 r        read A_picks from "data.txt" with delimiter "\n"
) g! W0 l5 P4 F! z5 ~4 h        set load type to A_tote
: J% ?  @" @5 |7 q        if A_tote="tote 1" then set A_induct to 1
# d; i0 ~0 w' N' {- V0 M        else if A_tote="tote 2" then set A_induct to 2
- b7 t" x7 `: c+ d) j            else set A_induct to 3   
$ `) \% h; d+ e4 |+ R6 G4 H8 r        set A_i to 0
0 ^* D7 S2 R' p; o4 s6 a8 _        clone 1 load to P_induction% X+ P' d3 `, k7 [/ }/ G7 s
        wait for A_time sec7 J8 ~! X2 c( U* ~
    end) H& q9 @! u3 @! P- J" J
end; D" g; K1 b; X3 F
4 }+ [3 m' n/ t. D! e0 g6 @
begin P_induction arriving
2 D, F* C( S3 n# C8 f9 n    if A_induct=1 then clone 1 load to P_pick1. v7 k2 j7 X% P; z4 f( A( o$ X
    else if A_induct=2 then clone 1 load to P_pick2
0 d7 Q& b. Z' z, W+ ~% \4 j7 l        else clone 1 load to P_pick3
6 S- @3 A) ?; |: D7 Y/ {8 s  @end
3 d0 R; S4 N$ y& e$ {) s7 ]1 {: b
3 I- g( Q# S% ^8 kbegin P_pick1 arriving# m: `" c5 |% ~: J  T8 [3 N
    set A_i to 19 U3 t: o5 }. M: \, ~
    move into Q_induct1
8 ^' [7 F+ f6 g; y& a    move into pickaisle.induct1
% u7 B, h4 W% n* N1 G; N" {1 Z    while A_i<=30 do begin* }* \2 u- Q! w0 F7 o9 [# o7 ~# s
        travel to pickaisle.con(A_i)
) Z* @4 N+ I/ v! e  Q; q) ?) H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 ]/ e9 r3 q% \! i1 q! M5 h! p) F        else wait for 10 sec
1 W- r% s4 [% ?. |        if A_i=A_leave then send to die) h! i" ]+ p8 R  _
        else inc A_i by 1
7 U! ~: M8 g" N6 H2 n7 D    end! `9 d# ~4 K: N( G
end- d% x; [: _! X/ h# z& Q  c$ ~

/ g7 Q0 }$ ?9 o! ~# R% ]8 Abegin P_pick2 arriving
" k3 U+ U8 i; q    set A_i to 11
- U/ ~+ w. I) q2 ]) e    move into Q_induct2
6 A; t/ K9 ?" Y7 V    move into pickaisle.induct24 @' W; y$ o' h( L% {! M
    while A_i<=30 do begin# d1 J& I: S8 s2 l  Y) q: {' o
        travel to pickaisle.con(A_i)
) d. M! _0 g: X) X# A) b* ?) s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  o$ ~& l. Y" L* x5 c        else wait for 10 sec
. l" c* r3 S5 h( d; i6 G0 e' P        if A_i=A_leave then send to die
+ ]: A4 l: h5 Z6 }5 g        else inc A_i by 1
' \( X; H9 _6 U% v$ i& C' B1 q/ j" L    end( s3 i* z5 m3 [5 E/ n" K5 z/ r/ l
end
# j, j# n  B: k
8 Q& @$ {$ `" ]- j% _begin P_pick3 arriving
3 o) d  S9 _- x    set A_i to 21
$ p6 w, A  H6 g. \8 t+ P  ?    move into Q_induct3
2 H3 _  p# t1 z7 t+ B    move into pickaisle.induct3; M2 a6 L  [2 ?  Q9 _$ k# D
    while A_i<=30 do begin7 W& W6 V3 ]+ |0 u3 T- K# G4 X
        travel to pickaisle.con(A_i)
/ e/ f) J3 _3 j1 p' E7 A* P1 e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ m/ d" @( {+ S( s
        else wait for 10 sec
0 ^( _, {. w, t7 ^        if A_i=A_leave then send to die
" `% ^9 L- P3 h7 ~  }) T7 }        else inc A_i by 1( q+ J6 Z5 L/ p4 U! H8 y
    end( D( c$ m  |+ ]6 I! y
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是个什么东东?
& a" }: k( q4 |/ q9 H" Rmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" J- l4 ]- P5 K% J/ H& g1 J6 o# N. W( d9 K. |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- {9 ~8 _7 u. G$ s4 N& f

& H. L: O& D* i) o8 J9 u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 g, b3 O  w4 J* d- ]/ |
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 V7 k9 Q  `$ `* o
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" u  w  U3 Z) ?, ?* i4 o" r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 t4 E) |! c- h4 t
begin P_induction arriving3 A4 j+ D- v  Q( d- P5 H- C! Q
    clone 1 load to P_pick(A_induct)
$ d; ~5 l+ r- C7 Fend最大的系
9 q2 p! k% ~; K! ]
4 J8 M: g, o0 Ebegin P_pick arriving
! @" f/ T; D. o' z. d0 M/ r8 h' P    set A_i to procindex * 10 + 1
, {6 B1 C, d* C/ o    move into Q_induct(procindex)
! x7 d8 k2 I# T5 d    move into pickaisle.induct(procindex)
/ j; K- z& m! `  w7 H. |4 {/ c    /*check the type of pickaisle.induct(i), for your last problem.*/
( X; }  V& O# B0 Z9 v$ r% V& B: ?" K
    while A_i<=30 do begin
( s2 y4 v) }4 z: T( B* \( L        travel to pickaisle.con(A_i)% \% m: e+ e3 l' F' x8 \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ {5 G/ R" I6 i% O+ ?        else wait for 10 sec
7 i; z5 k' d# d        if A_i=A_leave then send to die- v( c' }1 n/ I! f1 W+ @' U
        else inc A_i by 1
" a& R6 a; y' d; z* l$ @    end
/ m. z2 R+ h- Y: c  P& ^* S  Hend! ]$ R# l1 a% d! Q1 f8 S

% i" t* T/ w+ N; t  m其中的procindex为整形,代表当前process的序号。  U  [4 K( i% a
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-2-1 23:09 , Processed in 0.016930 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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