设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15076|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Z: R6 w2 q7 r. K6 ^

( w/ i6 v( p9 g6 n我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 G. l5 s" b9 y# s4 n
1 c. G3 X5 R4 y7 Q+ qbegin P_read arriving, P" g8 G  b) z% K6 m( P
    while 1=1 do begin+ H4 R. |7 g8 o' S9 C2 K
        read A_tote from "data.txt" with delimiter "\n"
" h/ i! W, R# g2 }" d        read A_time from "data.txt" with delimiter "\n"" j" P  u2 r1 O7 ^7 m
        read A_leave from "data.txt" with delimiter "\n"2 R! ^$ `2 J# I# D' g
        read A_picks from "data.txt" with delimiter "\n"
' a8 o2 K# ~9 Q2 U- J        set load type to A_tote
, ^; F. ?8 R/ H7 P        if A_tote="tote 1" then set A_induct to 1
0 `9 _3 O* \8 q. c8 c1 e* m1 R        else if A_tote="tote 2" then set A_induct to 2" {* b9 h. R7 B) x
            else set A_induct to 3   
2 c0 G0 U4 ~7 d0 I- q6 G0 b        set A_i to 0
  e# x2 A3 s% ]; s& Z* R6 S        clone 1 load to P_induction; [( ]5 {* h( ~% v1 s0 u
        wait for A_time sec5 [3 u- U" {0 |# J0 S) w
    end3 u- x2 u3 C6 x: A% i8 t9 y: y, p6 i
end& M! O' z6 S, U1 F& m( O) ^

6 X# {6 X1 [! h; rbegin P_induction arriving9 d2 O& M0 g3 ]2 P( C9 |
    if A_induct=1 then clone 1 load to P_pick1
. ^1 ]* m/ q- D, r5 U# F) U  ~) A    else if A_induct=2 then clone 1 load to P_pick2
3 R$ r3 J5 P5 Q: X        else clone 1 load to P_pick3/ D5 I; U+ x& ?' }6 t& G
end3 F6 \, {4 |  p0 E0 Y

$ Y6 i7 o1 f' _- H  B, kbegin P_pick1 arriving
& W( E7 M8 [. Y    set A_i to 1+ o4 C) R* f  c5 B' \, O! t. F; ]0 {
    move into Q_induct17 u) s8 ]" ]6 h/ s
    move into pickaisle.induct1# t6 w4 f% P1 ?) t
    while A_i<=30 do begin
0 }- d% d: _  a1 t; N! C        travel to pickaisle.con(A_i)9 ?* x2 T* D1 M+ Z, n. B8 w3 v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  `0 a- x  P( v2 T4 U        else wait for 10 sec! v* R. c' ]) D; A/ G" r7 h- I
        if A_i=A_leave then send to die6 [' d( }6 E- u: z( B) V
        else inc A_i by 1: e& C# P# A3 |2 b  r; q( q: |
    end
" l% e/ Q; k, _end: M1 {& h$ R7 Q( y8 W1 B  f

9 ?( E2 C! S' Y* j+ d( {* a  Vbegin P_pick2 arriving2 Y" K" S6 l) r4 h' o0 @+ ^
    set A_i to 11; E1 x; H1 Q( \5 v! W
    move into Q_induct2# C* H* n7 d! G
    move into pickaisle.induct2
2 [% \& ?% p5 i9 B9 i) s* h    while A_i<=30 do begin! v  k, e  e" ^) p; P! ~" f
        travel to pickaisle.con(A_i)
6 p, E& F5 b6 u$ f, I! _: }/ S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) X( X1 i8 R7 W! X" q; U
        else wait for 10 sec
0 Y1 f3 W; G! u        if A_i=A_leave then send to die
2 o1 u0 m! |( n* ?* S$ S( V        else inc A_i by 1! ]( ?- j/ k+ ~6 e9 A' Y
    end: q- B7 T; f5 p  R! w+ a( ~( _
end, ^& f1 u& B5 M+ h, s) B
7 B' M5 p& m( I& ~- L
begin P_pick3 arriving  P* x, S' P  c) ?5 g  D
    set A_i to 21. q/ s9 t9 T$ J# S! y' [
    move into Q_induct3  R3 S. p3 J8 D- K3 K- n1 n
    move into pickaisle.induct3
" k3 A8 U, j, K5 ~+ b    while A_i<=30 do begin: P' ]. [$ P3 F9 n+ Q* t. s
        travel to pickaisle.con(A_i)
4 `6 a6 M; ^: `+ V! @5 f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, L1 Y* m5 \  |' K. n; |" p        else wait for 10 sec
! ~9 r, c% S0 G4 g+ j4 h$ _        if A_i=A_leave then send to die- @! p  T* P" ~$ B; r$ A+ A
        else inc A_i by 1, H& [8 D. m) \! q: _7 M, B
    end& k+ k# Z( a  _" k$ C9 \
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是个什么东东?+ k5 Y3 Q/ X& |6 A+ Y# }+ K
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  H6 g1 S3 E  W" M. r% W  \( l+ i: R3 O0 h, v8 |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; U, _# `6 K3 P( ?( E# w3 s7 J* ~; Q# a9 r1 w7 q0 W0 O' u) }2 p/ ]
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( @9 y9 @! Y" f, S, y6 m- s  Q' W1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 A% w$ Z! o/ q/ l& R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) W; x# o2 _  M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) e6 w  F3 S6 Q( W# M8 {
begin P_induction arriving9 X# ^& h- ]6 \& c
    clone 1 load to P_pick(A_induct)0 ?8 [% @, J/ e% `, Z
end最大的系9 ~! P' X4 `9 p- w" P

$ \) @7 _! N8 A, Tbegin P_pick arriving
' ^! n+ F# t& e; B+ W# E; k    set A_i to procindex * 10 + 1
% s' T% O7 `$ C: l# z    move into Q_induct(procindex)9 b6 W) f8 f% l
    move into pickaisle.induct(procindex)
! U' K9 d# S8 [# u: m    /*check the type of pickaisle.induct(i), for your last problem.*/7 W7 B: Z: I0 h' w& E

' ~8 Z9 _% {# C/ T) _6 d    while A_i<=30 do begin
' x$ [+ Q9 }% S9 ?) A        travel to pickaisle.con(A_i)& C3 Z2 V3 H3 c3 g1 k, l! S4 C7 S/ W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ a8 i! v0 o  R0 E% J        else wait for 10 sec
$ F2 t- r7 L' C, `7 o8 k        if A_i=A_leave then send to die/ }7 \8 a3 n) ^5 D" C8 v
        else inc A_i by 12 s! ^+ M: Q& C/ c" q
    end0 W3 L' g. j& G# ~# O
end" @6 M* R) V) v# N1 X) C& g

' K" U; y9 H! \4 Q其中的procindex为整形,代表当前process的序号。4 V' B( [+ w/ P! x
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-8-8 07:08 , Processed in 0.017856 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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