设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13053|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 B) q/ W2 T" y+ I2 ~+ j% k2 s
$ [" C7 r) A& ?; N; b我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 t/ Q1 g* F4 l- q

6 M$ i) B5 E7 M7 a& \- J- Dbegin P_read arriving# h( u1 e8 V2 Q; E# @% z+ _
    while 1=1 do begin
: E5 P/ B8 y9 C( s        read A_tote from "data.txt" with delimiter "\n"
$ R" L% u! [2 B5 c  f: N# `1 C& b        read A_time from "data.txt" with delimiter "\n"  i( C3 s( C- @. z8 ?# M  z
        read A_leave from "data.txt" with delimiter "\n"# q- Z+ V' R- R# u3 t+ L
        read A_picks from "data.txt" with delimiter "\n"" c. Z' ?6 Q6 p' K
        set load type to A_tote8 G/ s5 J! g' a3 W6 |. {2 y2 x
        if A_tote="tote 1" then set A_induct to 1* w- T* J/ ]* B' c
        else if A_tote="tote 2" then set A_induct to 2
: u0 m6 @7 j/ j: A) s5 _; g0 T            else set A_induct to 3   
* D% u3 w! ^4 Z- d        set A_i to 0( y1 ?+ |. l  C% g, I7 s
        clone 1 load to P_induction
5 K( }% @3 J  w! H' C2 V        wait for A_time sec
% `, R% P3 z- B* h$ o! f! d( R) j1 a    end
# g; B: E5 `4 g) hend
/ n6 F, ~9 ^% Y
! Y7 o- o9 |( A: jbegin P_induction arriving
7 C: b/ ?7 i" N    if A_induct=1 then clone 1 load to P_pick1
) J  c" k. N! ?& t    else if A_induct=2 then clone 1 load to P_pick2
' h( y/ _* K/ g# S; h7 |$ @        else clone 1 load to P_pick3
: p0 g! K, K8 o/ Z/ ]* j3 p, xend
- }+ ~& U6 ]+ d3 D3 x# s, R/ t* R) n) M3 ?
begin P_pick1 arriving
4 S, W- B$ M  p2 I9 f* ~5 S5 [    set A_i to 10 @. k* T$ ?  z4 c2 G
    move into Q_induct1
2 w: h; ~2 e/ g7 j    move into pickaisle.induct17 {# f. g( S3 `! Q1 w/ C
    while A_i<=30 do begin
; n! z" M1 e9 S        travel to pickaisle.con(A_i)( _4 O: f' n' }$ _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 N; z, X$ v( q
        else wait for 10 sec
$ C5 ~/ Q& c- |) X; @        if A_i=A_leave then send to die* i! c5 J/ A0 Q' p
        else inc A_i by 1
# T. T# X0 J, ~$ _# E* {    end
" r2 _3 `3 w0 k9 r) J  T2 q( cend
4 I2 K) ?- Y6 `8 n- e; o0 P; J6 r! }5 E: B
begin P_pick2 arriving
' g! |3 t1 e& ^    set A_i to 116 u& C3 D) ^% g2 ^8 y, |2 G: F
    move into Q_induct2
5 I- B  D( s6 u" ]    move into pickaisle.induct2& g% k) |, X6 {; R
    while A_i<=30 do begin) Y& V& A* Z" ]# O; V7 a8 q% a# Y
        travel to pickaisle.con(A_i)
/ c  m  p: M/ R* L# X' a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 r1 b; u, i. q) a  W        else wait for 10 sec/ ]4 U1 Z3 `1 Y! x0 _9 I  L
        if A_i=A_leave then send to die1 O$ V& v+ {! m- I6 L/ n
        else inc A_i by 10 p5 g5 r- a7 s6 p+ b
    end7 T6 `7 R1 a7 |# R1 B( Z
end) s; p: W+ d# n3 r- V, _5 E
' j" x9 D$ d9 D' f7 x/ J
begin P_pick3 arriving
" J& i7 P# X3 F4 T. v    set A_i to 21
( A* i* W5 j  @' K    move into Q_induct3
- d+ x5 p9 R& D' w    move into pickaisle.induct34 {7 [( n8 R3 E* j/ m
    while A_i<=30 do begin* R# s* r4 i: i2 ^! F5 n
        travel to pickaisle.con(A_i)
" q+ Y7 Z5 l% E3 c, V9 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- v  [+ [4 N# v9 u        else wait for 10 sec
6 ]6 C' b) m" l  R- I        if A_i=A_leave then send to die
8 u$ X$ h0 h7 `8 x" y        else inc A_i by 14 C5 s. R$ K1 H: m7 C# c1 }) f1 ^* c
    end
4 u0 {2 J* w, {: {6 B9 G' }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是个什么东东?9 u) u+ K! V0 o4 p. Z" j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?1 J# y) `  Q  p) s

" c8 _1 B# W3 EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 H3 Y% Y7 u* Q0 W, C) @3 K' U7 w
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:, d3 Y+ d* Q* J5 Q: a5 Z2 B
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 x" F  W. A' j$ U/ h; c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 X* p$ O. x* B/ y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ }7 o5 t# _! f) ~
begin P_induction arriving% @& A2 ]' e# D2 }+ T
    clone 1 load to P_pick(A_induct)0 M. j9 Y; o6 V: M
end最大的系
' g7 w' l- M1 {0 h. t" a) ?: @' Z) q4 Z* b9 n# Q2 D7 Q% _
begin P_pick arriving
" S9 L! K. [" K, P5 t1 E    set A_i to procindex * 10 + 1
4 d8 y/ n- W$ i. M: b" r1 G    move into Q_induct(procindex)
' @/ x3 T& R6 ~( C    move into pickaisle.induct(procindex)
% t+ a( }+ z% w5 X    /*check the type of pickaisle.induct(i), for your last problem.*/- B' T5 z' [( |2 c- H

( j5 v1 D# |+ r# z    while A_i<=30 do begin
7 ?2 X6 M! y0 @0 S        travel to pickaisle.con(A_i)1 T& n1 r! m) `, h2 V! r0 @3 L; J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 s1 L* @: j% g& ?* r        else wait for 10 sec
$ W. V; j% h( `. |        if A_i=A_leave then send to die8 P9 @6 L6 b( g$ \
        else inc A_i by 12 N8 K& A1 H, j5 X. Z( Y" O" K. t1 j8 Y
    end7 J' y' K  `, X+ M+ p- \' ^" V  h
end
7 j; `2 {2 @5 R7 Z$ G) U' D8 g9 H1 T- N; B3 V, i
其中的procindex为整形,代表当前process的序号。- p8 ]$ X& ]$ Z. M/ l7 G( Q
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-3-13 21:48 , Processed in 0.016848 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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