设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15174|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) n5 u0 _. p  W* s9 s; Z) A, N  L& c/ V5 i* Q
我的问题是,在每个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 k8 _! c7 l2 s

5 y' n8 y- T' I# jbegin P_read arriving, g- P, V0 U3 w+ o
    while 1=1 do begin" J- V& B3 G5 v# w1 b
        read A_tote from "data.txt" with delimiter "\n"
% H  X/ o1 O4 ?% }9 w, N        read A_time from "data.txt" with delimiter "\n"3 B0 ~; {' b& @  g  @' K" Q
        read A_leave from "data.txt" with delimiter "\n"
6 Q) F  ]: j2 Y        read A_picks from "data.txt" with delimiter "\n"' y8 p) v) j  a  n0 I2 A" H
        set load type to A_tote
: H4 A) V' H1 L, f6 u        if A_tote="tote 1" then set A_induct to 1( L7 N7 V0 H2 R6 [, [
        else if A_tote="tote 2" then set A_induct to 2
- {2 ^7 \) \9 @" y) W            else set A_induct to 3    9 T* ^7 [+ ]; l9 J
        set A_i to 06 W  y( g5 I5 |
        clone 1 load to P_induction/ _: Z. e6 k. J, m1 d' r/ O- J) T
        wait for A_time sec
; h* Y3 c$ l5 [+ M8 W  A3 D3 r    end
* S3 f" Y3 b* `6 w) [/ y0 |  uend
3 V* ~$ W' D( P" Q: k! W, z$ @6 G6 T! T8 j% [/ _( Z5 H
begin P_induction arriving5 ^+ T. F  D0 _/ T. u. F' t/ ~6 V
    if A_induct=1 then clone 1 load to P_pick1  Y- k& G1 i: l' K3 @
    else if A_induct=2 then clone 1 load to P_pick2
' {$ j$ y. P9 u* _" l. a3 B        else clone 1 load to P_pick3) j. x5 S* V% A0 O3 p
end1 r# u% ]7 {. b3 ~4 ]& j! S

8 E' ?. Z+ x2 O. y. w7 X( Ibegin P_pick1 arriving9 Q. _7 y/ F- u
    set A_i to 1
4 n  D6 l+ i9 }    move into Q_induct1, i* V* A+ o8 q9 @5 v, \4 p( x
    move into pickaisle.induct15 s6 E7 e. ]5 h8 a
    while A_i<=30 do begin$ }, c" A0 R. R: W0 A
        travel to pickaisle.con(A_i)
+ E: {( z0 @$ `2 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% L5 D2 N: A; H0 v( {! ]8 D        else wait for 10 sec
8 a* d6 d, U$ X% ?7 b        if A_i=A_leave then send to die
" K  }* B. M& c1 d        else inc A_i by 1
4 m& M3 Z2 P7 O0 z% P0 ?    end
. |1 q9 P. A9 g" x4 m& ^' \4 i; tend& X) _  r! z# A* b$ ?# Y! W3 `

# m/ l* O8 d7 E" y$ `( _  `begin P_pick2 arriving
/ C9 K" t- S2 u2 q    set A_i to 11- }) W  C; w9 o
    move into Q_induct2
/ D) i; C7 s0 R4 l    move into pickaisle.induct2
1 t  e/ L5 A5 \3 c' ?    while A_i<=30 do begin9 |$ @9 I4 X. V& }" o
        travel to pickaisle.con(A_i)
$ L( c, s' K* }' |0 ?8 g. {+ ^$ N3 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! m& y, v5 q+ c3 J& [        else wait for 10 sec
) }9 v; ~+ A9 q0 }5 S! m) f4 ]        if A_i=A_leave then send to die0 J6 `4 ^9 z6 \  X0 w
        else inc A_i by 1( r5 U; B. W% [4 j/ k$ g- n
    end. @; P4 x8 n) a# [, ?8 U8 O
end
1 K# R; [& ^7 E. l" N  G- p
: J- Y2 q' l& x) m- U1 n% Gbegin P_pick3 arriving  W# W3 F& c- \1 }' k: l+ }
    set A_i to 217 ?2 V  h" x: T( F* J
    move into Q_induct3
# g* `: e- c! J0 H, W    move into pickaisle.induct32 z4 f8 c) P: f7 A; G- G
    while A_i<=30 do begin
: a' Q8 N/ G# M: s3 a# J        travel to pickaisle.con(A_i)
! _! ^: G3 b% l( D' A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 c  i$ j8 P* l, f
        else wait for 10 sec
0 B4 ~) k9 R7 |! u6 \" B! k        if A_i=A_leave then send to die: @0 r1 R4 a' A1 ^: J" m
        else inc A_i by 1
: o# y2 h- @0 o. Y4 ~( k    end
5 o6 e7 u4 L2 i4 s! f$ Cend

最佳答案

查看完整内容

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 m+ ?0 g3 b$ S5 ^# ^; i: p1 r# zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( \( @! I7 S/ a; I! A5 C0 [

& z$ g0 b7 t) E$ rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& E+ Y3 `2 R; k+ G9 k( `  d* ^+ T5 b: K( q# x3 D; R$ X
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) H  o6 m% G3 v1 @
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 K6 C; b$ x9 N0 V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ p3 K( S8 W8 P+ o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 [$ S# G$ L) d. d' e" h$ ]" A' xbegin P_induction arriving
5 R5 o, t# W+ m! i* j    clone 1 load to P_pick(A_induct)# ?* d" ]* h4 N! d+ S" _& c+ Z. g
end最大的系% R" W9 k* [1 ^4 H# O, c% d
! B/ T; |0 x' R3 r1 g7 `
begin P_pick arriving
  |2 w/ `# g8 l' F    set A_i to procindex * 10 + 1
4 ^& c! N1 o+ v5 r    move into Q_induct(procindex)# Z6 m& @2 `! ^  j+ \/ ~" j- D
    move into pickaisle.induct(procindex)
! b* U  e" N: l4 m    /*check the type of pickaisle.induct(i), for your last problem.*/
! M5 C3 L7 ^% J0 S8 ]; p/ w! u
7 i: {1 h7 |' f- [6 T% E    while A_i<=30 do begin2 `3 ]: k6 G0 d
        travel to pickaisle.con(A_i)
  ]; `. ?, V2 U( H) u/ R4 S% `1 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 n  i9 e5 [% U. l% o  f% `  R
        else wait for 10 sec
- s6 h  p5 H- S9 A        if A_i=A_leave then send to die( \0 D* h) w2 o, _
        else inc A_i by 1
( x# N' J: X% ?% ^    end
" L2 N) V3 q+ [7 j1 Rend+ s0 w6 {' Z0 z1 w4 C

2 L: ]% U8 C( f3 D" G' G其中的procindex为整形,代表当前process的序号。
- }  F& R% W, p/ A  k  Estation和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-8-19 16:59 , Processed in 0.014514 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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