设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12431|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* u3 Z4 E. Q0 `) k& ?8 V* `
! F# `9 e( O2 d( c5 U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# o6 A  k  r% K( J8 a2 x( c5 O
! Y; E( l% w6 r4 m- C0 J. L5 Gbegin P_read arriving
1 e( X1 Z* e- h! l% o: Q    while 1=1 do begin: e; t: ?) x- Z2 @# h7 ~; z, M
        read A_tote from "data.txt" with delimiter "\n"4 A" y- D- C8 C8 w! l! C& i
        read A_time from "data.txt" with delimiter "\n"
/ l% A8 b2 |- B4 f; C# c# T        read A_leave from "data.txt" with delimiter "\n"
7 C8 b" z/ }3 H) d) _        read A_picks from "data.txt" with delimiter "\n"/ g  e: ?3 ~# j( x' z
        set load type to A_tote/ X- T* {% s, Y: M& \
        if A_tote="tote 1" then set A_induct to 11 @5 {1 J( e0 x+ C+ d
        else if A_tote="tote 2" then set A_induct to 2
. z) A! j1 T) _) \5 ]' B9 s2 r            else set A_induct to 3    0 g5 A. }1 D0 C0 F$ w: [! y# u8 u
        set A_i to 0
/ R& `% n* \; d2 |% f        clone 1 load to P_induction# W% B- L$ Q1 ?/ `5 k9 i+ |
        wait for A_time sec
7 J0 C3 U/ c5 O: c# N3 ^3 g    end  Q2 G( f- F  y( Z2 o& r
end
8 v6 J1 Y8 g! l- d$ C  l( ~. u, M* k& P$ Y
begin P_induction arriving
( j! K& h. V& Q% P( w. {    if A_induct=1 then clone 1 load to P_pick1
; G. q! ]% e( R( O0 F% |, `    else if A_induct=2 then clone 1 load to P_pick2) n& y; _/ |/ d: Y6 [' Q
        else clone 1 load to P_pick3
& Z. {* l5 z7 p( D5 s/ S7 V+ p$ cend6 o. [9 @5 ~6 P; I" ~

- A1 o, Z: Q: x/ R! C4 M2 ebegin P_pick1 arriving
! k" R: `; ]" |( c0 V2 t    set A_i to 12 ?/ ~9 l  x  K! m  A
    move into Q_induct1
* s  Y8 X2 c3 j    move into pickaisle.induct1- ]1 b5 y' A9 h/ O2 L+ Y+ L7 H! y* a, k
    while A_i<=30 do begin
+ _. ]0 m/ x5 \% y& l! Z. [6 F        travel to pickaisle.con(A_i)+ d6 Y: f# l9 \% [) P& ]# Z' Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 F1 O0 V/ T# _# M& M
        else wait for 10 sec
& w- L! |+ J. \2 z* q  o        if A_i=A_leave then send to die
7 \) y7 }9 d% E' C5 m        else inc A_i by 1
, X6 R1 t  U- i4 S* h8 |    end7 ]# w, o! J, d! j% S
end
7 }) m, w6 M8 \2 Y+ m# a! Y' i+ K( y. y5 ]8 I9 v
begin P_pick2 arriving
% h$ r1 \, d" u4 |0 N7 x' u! P    set A_i to 11/ `# r5 x* e) f
    move into Q_induct2
; k2 ]) B9 _, ^/ [    move into pickaisle.induct2: P1 e( F9 y0 K9 n  X  |  C
    while A_i<=30 do begin
3 T) v- ^  q1 k1 l- i# |        travel to pickaisle.con(A_i)
1 b: N3 Q4 u- t+ j! ^% m& Y7 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, G0 v. K# f2 X, R3 T' e        else wait for 10 sec
  z/ {; F9 f( \+ W( F% ?2 N% m        if A_i=A_leave then send to die0 h4 R( I$ k0 w% h" H3 u7 m7 S
        else inc A_i by 1
7 R" Q, \. h) ~4 g    end
0 m, S& v+ P$ s: G1 M$ h) jend
5 i* U5 |) A! ]- u
4 @7 k9 @5 d0 u' ]% ]  Sbegin P_pick3 arriving0 c( \0 ?: |" H# L
    set A_i to 218 D% B5 d5 D" d/ q. ?. ~
    move into Q_induct39 o0 s6 D; L) t: m
    move into pickaisle.induct3
  Y. Q$ g* b& X/ ?+ X$ G- i    while A_i<=30 do begin
- j$ s1 F' V& k/ r        travel to pickaisle.con(A_i)( a- \9 @$ e4 f& F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ?$ G* C! @$ a" M; Y
        else wait for 10 sec% [' V) G1 X/ D" h% Y9 V2 t
        if A_i=A_leave then send to die
& g6 E% b3 U7 q+ c: S+ p        else inc A_i by 1
. X* Z( F0 t0 U2 Y# y4 g    end
: J8 f8 S) @  u3 F" k, D+ xend

最佳答案

查看完整内容

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是个什么东东?4 C, l; m& @4 ~! z  m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 P+ F1 i7 f) a2 \. p' p  O0 i% B
7 ~5 g& w4 u9 U! VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) W! a* P, l3 j& ?5 }- z# x6 v; E3 L

* w1 Y6 r: M% V$ |' L/ R# p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ ?7 [5 O  h# m) d& T# T, q+ ~" U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) k! y0 s2 A  ?( v. a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 }" D: Z% T; ~- z* k
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 Q9 |7 Y9 ]) ~# m: Q: K
begin P_induction arriving3 x$ I) Q$ L1 q) j5 v, _
    clone 1 load to P_pick(A_induct)
2 F1 U- {, o! \2 Q: Y: Z! V% kend最大的系
' f/ c  X% Q) j" O
6 U1 T, O% j9 s9 ibegin P_pick arriving
" J7 B. U$ o7 G. h1 N7 W/ f    set A_i to procindex * 10 + 1
2 D+ B/ J% K$ N  U# @    move into Q_induct(procindex)
9 }9 Q& K( f" D3 d) f, s    move into pickaisle.induct(procindex)
% ~7 I3 e" S( t6 A/ \- h4 b    /*check the type of pickaisle.induct(i), for your last problem.*/
% o0 T, j: _. V0 C$ E  P4 z4 U" R0 }$ v. {
    while A_i<=30 do begin
. s* Y! u1 ], m) H* d* {# }* I. P( f        travel to pickaisle.con(A_i)
8 f- a8 A- n$ s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ t0 I8 ~' d) z# z: n* t
        else wait for 10 sec6 |: |6 G2 E. l5 X
        if A_i=A_leave then send to die
7 l. V# C9 @9 {. H7 ~0 X0 I9 y        else inc A_i by 17 k! O0 J  j5 e5 y$ A  a
    end
1 W4 `- Q2 ~: iend$ ]1 G( Z+ G) b# _9 y. x
& [+ b. w4 w8 Q# H7 V
其中的procindex为整形,代表当前process的序号。
! x2 N5 Y- m8 w/ F# C# {; t, @" Rstation和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-22 17:08 , Processed in 0.020095 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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