设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11633|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 }1 F+ l5 }- e4 K
; j  ?' h6 S& D3 B7 i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. m" N+ S% ]3 R5 K+ t5 o+ |1 Z
% Z( l% X: d% n/ v, t+ w9 ?
begin P_read arriving# n' |# p' y9 ~$ {: j) ~
    while 1=1 do begin( e3 \4 x/ S6 @. H6 _( O7 u% C
        read A_tote from "data.txt" with delimiter "\n"3 h0 y: z" ~2 P1 m. k: d7 z4 ~
        read A_time from "data.txt" with delimiter "\n"1 }" I: T1 L: u4 s. [( u
        read A_leave from "data.txt" with delimiter "\n"
; t7 j0 b; q% l8 x$ q5 r        read A_picks from "data.txt" with delimiter "\n"
% C7 ?4 j) ?2 O. H( A        set load type to A_tote
( X" b" m- s% P- ~! Q6 o7 }        if A_tote="tote 1" then set A_induct to 1& j& m+ G5 S" y* e
        else if A_tote="tote 2" then set A_induct to 22 X/ E) N  i5 r7 `  z+ f! s
            else set A_induct to 3   
4 G5 C, c9 {, d3 |) j( w3 s- Q        set A_i to 0
: M. c  N: j7 f. r4 i        clone 1 load to P_induction
9 ^3 c) Q  K' {- X' H: U        wait for A_time sec  e' h+ V- H. J, ?- U% C: h
    end1 t" i1 G, V" V0 Z  P& F# {( V1 Z
end
! @, r, h4 M3 I, u% I$ v# O$ D" O- x+ l% z5 Q) g
begin P_induction arriving
8 G% o/ S6 l! U3 w6 n    if A_induct=1 then clone 1 load to P_pick13 C3 W3 t/ l- ?) ]5 l
    else if A_induct=2 then clone 1 load to P_pick29 T( y3 w6 p( I  p
        else clone 1 load to P_pick3
5 u5 s& ^2 u% w( W$ send! @( Y- P' d: G. w. X
$ r8 b% m1 D0 Z2 S* i: |
begin P_pick1 arriving
5 K0 y5 {, V/ N7 A    set A_i to 1
, Z8 k2 |4 b* O9 i  T% D8 t( ?    move into Q_induct1  ~& F% _$ z' {- z2 R
    move into pickaisle.induct1
  v% i0 K. [2 C; n, x) J. f* H0 h    while A_i<=30 do begin3 {" J+ P7 c1 \3 ~' I: E  `
        travel to pickaisle.con(A_i)
$ `2 O% k" e% S4 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* d- V. h7 |6 x0 H! \7 O! L
        else wait for 10 sec
# A* q5 f% K* n/ @        if A_i=A_leave then send to die2 Q) W( g1 u$ w5 }; @$ t. n  I
        else inc A_i by 1& [/ A2 K( b' [
    end
# N& x$ H! B; f9 n  uend9 ^3 J" M" y0 D0 B! C+ X
' {: v6 |0 Z% |9 ^! H# i
begin P_pick2 arriving
5 D/ M" v* a' z1 [7 ~& d    set A_i to 11
* l" g0 M+ N" r* D2 R    move into Q_induct2+ C4 {' ]6 z9 D" I2 ^+ G' d# N
    move into pickaisle.induct2
: p: x. N$ d- _- b- P: c+ R    while A_i<=30 do begin
, Y6 f7 w  |/ a# g5 i        travel to pickaisle.con(A_i)
* ?/ K/ M" G* h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 U9 I4 j' U4 }% ], v
        else wait for 10 sec- ?# S- [3 _8 O: A; S
        if A_i=A_leave then send to die) d! P" Y' E. w5 s; a
        else inc A_i by 14 n' N* m" n6 n3 }5 ?
    end
* [, d5 y6 a5 H6 `0 Z2 x: o4 C2 qend
5 J. C/ R, u+ N* G7 A
1 u0 a- a' l( H' Y6 P0 [5 F- jbegin P_pick3 arriving
6 B5 v# q( ^. L; ^+ ^! x1 e& d    set A_i to 21
' e! H3 W: A- J: y3 U4 {    move into Q_induct37 c: Y; b- S& ]2 |, U, E& M  y/ b0 ^
    move into pickaisle.induct3# ~% B& \' w5 k9 x3 J+ N  E
    while A_i<=30 do begin: `9 ^1 U& d  u. [/ ]
        travel to pickaisle.con(A_i)) N: \& X$ h; M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: a: Y5 B# G% f3 B' \( }
        else wait for 10 sec  [4 d9 X& O6 z, A" ]3 B/ w
        if A_i=A_leave then send to die
+ b# T. m5 P+ V3 ~/ _6 ~; E        else inc A_i by 1
! a1 H9 _1 W" s7 n& Z! g! z    end7 b; ?' w1 w' Q; l* ]1 X1 J
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是个什么东东?
! v, X  @) G* Cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& R+ j% D# q6 k  V0 a5 x* {+ V; p

4 y+ j' f3 |$ p1 Z& o& EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。6 J, w# E( ?8 u; E0 {% s1 b1 v

% s' ~! m! z+ V" \; |* B6 q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! M$ y( I( T# J& `$ D4 F/ o6 D1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  P- F: X2 W3 o* f
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! T. e, t& F0 b% {' s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 [; H; R+ G  Q, g, K$ t. c$ H
begin P_induction arriving
% U2 A: a/ z! T9 L0 ]    clone 1 load to P_pick(A_induct)
" Y! g4 l7 J* ~! _3 p# W# eend最大的系' i! G  E7 [* K+ N6 q4 i

% V" O5 c2 T/ X1 [% ~$ _) m9 ^0 Jbegin P_pick arriving
% E/ ^2 b! N' \. ]6 n    set A_i to procindex * 10 + 1. I1 G/ G8 H0 b
    move into Q_induct(procindex)
& A1 o: N! N& |0 n! _    move into pickaisle.induct(procindex)/ q: j$ p! c" U( E
    /*check the type of pickaisle.induct(i), for your last problem.*/7 O3 k+ J8 h3 e

. {$ [* u) S" n    while A_i<=30 do begin
9 L" m& k7 V' G/ C  u- Y        travel to pickaisle.con(A_i)8 y9 G  C* Z% e, M; R$ s* z, P& M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 n8 R: R/ F- Z: w7 k& ^
        else wait for 10 sec
6 P. M! T3 z: c+ l0 a; L" n& J        if A_i=A_leave then send to die8 ?! M; u. v9 {6 |. ?6 l3 W
        else inc A_i by 1; H0 a1 M" b( i) `. T% g& R
    end
, ^1 t; R0 e* Y- ]$ Z7 [end
2 n( u6 o! y; b& B* U
  @  v  o  x8 c# b' \$ U- C6 a, s1 T其中的procindex为整形,代表当前process的序号。
0 S0 |: k& e5 R5 Q2 ~& nstation和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, 2025-11-25 01:23 , Processed in 0.016806 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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