设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12946|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% ^! {' l: e, O) X% w

. Z$ V" L# h  b4 [4 A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! h" z" x9 x7 N' B3 c/ }' h/ |/ S6 P0 v& \* x. w
begin P_read arriving
* q  w. s+ F& f    while 1=1 do begin- ]1 A7 A5 J7 U0 H; A# m6 v- H
        read A_tote from "data.txt" with delimiter "\n"
1 N2 H* e, l7 N: H        read A_time from "data.txt" with delimiter "\n"
: b& j( P$ s# g" A9 S4 e3 k        read A_leave from "data.txt" with delimiter "\n"1 i  Z: u8 z8 z
        read A_picks from "data.txt" with delimiter "\n"! \; _7 t# {7 M# e
        set load type to A_tote1 i/ e+ H) }- g- q4 n6 ^' F  h
        if A_tote="tote 1" then set A_induct to 1
; }+ |! X6 |5 j/ k        else if A_tote="tote 2" then set A_induct to 2
# I3 @, H. R) `% [$ T! a+ F            else set A_induct to 3    ) A; T# B# ]4 D7 E* F# R' k7 a
        set A_i to 0. r: K( q' Y+ H& h$ \
        clone 1 load to P_induction
  h3 H/ b" x0 ~/ Q7 Y5 j; U* h        wait for A_time sec4 g; z7 I& W8 B$ T( D8 }# b
    end6 {3 q  m) F% T$ N8 p. A  E+ H
end. |5 f3 E: {5 }5 w, B2 t3 J
, H0 Q4 {" U5 \" k8 l+ [
begin P_induction arriving
$ `) F+ c  l- q; R# f( M; h    if A_induct=1 then clone 1 load to P_pick1! G+ u- `# `% A+ ]- m5 A
    else if A_induct=2 then clone 1 load to P_pick23 G+ X/ C$ z% l4 L/ j
        else clone 1 load to P_pick3" {+ d# J- [3 M; ?+ J  v2 V8 \
end: v6 `7 L. d! C# @. m! F
$ z% u9 L. Q! h1 d3 g6 n) k- t* K: Y
begin P_pick1 arriving% T% C9 n% E  p2 X1 \8 W7 e: ?% H
    set A_i to 1" `5 Y/ n) T9 E0 e  }
    move into Q_induct1
- X8 T9 H& j" l% v* O+ v    move into pickaisle.induct1+ ?5 q. a5 G. ^, O. a  a1 i
    while A_i<=30 do begin
7 Y! x0 h- c0 }( }5 k        travel to pickaisle.con(A_i)8 j- I- g8 V! ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% T) x- {& |5 M3 p7 S+ t        else wait for 10 sec
  _+ i) N  f) c# C6 {# c        if A_i=A_leave then send to die) L! H( s" j4 w
        else inc A_i by 1
4 E  F/ K2 T7 R! G- S8 h7 @9 O# l    end$ R8 l6 o7 g, k  X+ p; i% |; p2 C" Y
end0 K7 f$ C- \. m7 c3 ~) G

5 Y' w2 N8 O8 I( s. pbegin P_pick2 arriving
5 k" p  }2 _, _3 w1 E: d" n    set A_i to 11
, x- n  Z, t" X5 l; o7 [    move into Q_induct2
1 V' H3 Q  e, i+ U    move into pickaisle.induct2
+ S4 M* I& D  p7 w( X7 T, t    while A_i<=30 do begin0 p; j) C- [& ^9 \! @+ L3 W
        travel to pickaisle.con(A_i)
. Z7 o/ D0 |5 ^9 T. z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 V' i5 j) M+ T0 R* Y
        else wait for 10 sec+ X3 }/ \( i* l+ z+ [1 p8 p8 Z
        if A_i=A_leave then send to die
, r( ~+ u: U; r$ e3 O2 \        else inc A_i by 1; m9 s- [+ X, x7 l" u# S
    end
; C( G; l$ ?% P0 eend
. L) B- D5 j+ g* Q2 f  w
$ Q# n- d3 S) |begin P_pick3 arriving
" x& l# }1 J2 J6 R8 y2 H    set A_i to 21
- a$ |9 W, O: e: |! D. B    move into Q_induct3
$ T: O" A' \3 B    move into pickaisle.induct3
" Z$ W# f: ?# }. k    while A_i<=30 do begin7 W5 Z5 F3 w0 y, w5 t3 C6 g( X
        travel to pickaisle.con(A_i)9 h1 k! F# j8 M* g- {  Y+ V$ {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 r# K* m0 Q( v* e: N
        else wait for 10 sec
) h: h3 G) |! {  W% G        if A_i=A_leave then send to die) t( B: a( U# m% q: o
        else inc A_i by 1
5 Z5 \( f' d9 \3 S* L+ e% k: _    end/ h; V. l. ^# U5 r) ?
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是个什么东东?
1 t; p' U  B& }! n/ T: N" f- S, dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, e8 l! _/ P5 P) Q
& h2 N2 w* ~; R# T  C$ r
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' C# s, U. M1 `+ |
; O' w  f; u  [
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* u$ Y2 t+ e' G, _6 [1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 |2 u& G4 l; Z9 |& S$ g# ^
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) A5 W) h7 q4 J- q6 N( }3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ S5 v4 a: ~7 v* g
begin P_induction arriving! Y8 `3 m% O0 N( a; W+ l
    clone 1 load to P_pick(A_induct)+ G1 V+ e3 k9 k1 q
end最大的系; j- \+ M) V: Z+ z; r8 y: _& @
( u9 r# b7 A: ?8 |: N$ b
begin P_pick arriving. a. s  G3 G( D/ E) Q
    set A_i to procindex * 10 + 17 g0 _- d& M9 U& I$ V4 J
    move into Q_induct(procindex)) ]' F, S4 K9 G. L1 Y$ w7 @
    move into pickaisle.induct(procindex)
9 i! b7 S3 t. X    /*check the type of pickaisle.induct(i), for your last problem.*/
5 _3 e4 f4 C8 k. y
! S2 s" d/ `1 |" z    while A_i<=30 do begin! t7 m- x+ @1 p4 w* M! l/ V/ S" Z( P
        travel to pickaisle.con(A_i)
5 y. p) W+ F+ |" g9 d. g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 C" X4 e/ a* @: b
        else wait for 10 sec
( Q1 N( R7 {; ^; l% N/ f        if A_i=A_leave then send to die
9 W5 g1 l3 C9 H% m        else inc A_i by 1, E- N) H! `: b3 @+ }- `9 v
    end
4 j, n1 e" w5 Z0 N8 B: p! {end
  t. C% [  E7 K9 E" Q! F' ~6 E! b. j# @, e  y2 L
其中的procindex为整形,代表当前process的序号。
2 [$ X# {) @( v) V  bstation和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-4 17:01 , Processed in 0.017638 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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