设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12927|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# @8 L" l1 X( e1 ?" b

- I4 s" z* Y! M4 p  X) K我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# O9 O; c: j/ v% d& ?' G, c# H8 ~, S/ e9 i
begin P_read arriving
/ d, p5 K( L* O% `5 z    while 1=1 do begin
0 K- V/ M) v; R- c% y6 \        read A_tote from "data.txt" with delimiter "\n"0 H/ G" m& H: v1 V1 O7 v8 S
        read A_time from "data.txt" with delimiter "\n"
0 S. u( W# |3 t  b! A# c        read A_leave from "data.txt" with delimiter "\n"; e2 u- p9 |9 p1 `
        read A_picks from "data.txt" with delimiter "\n"
( a/ B8 {% R9 Z4 p) h) [        set load type to A_tote( K& R$ K6 ^& p# X! g$ z
        if A_tote="tote 1" then set A_induct to 1) q) D6 ?2 u- a# U/ Z) l+ K# F
        else if A_tote="tote 2" then set A_induct to 27 l! O# R$ U4 N& u  B: Z2 i
            else set A_induct to 3   
  Q8 L! A2 C  f0 X        set A_i to 01 d9 l; K% T7 E6 [
        clone 1 load to P_induction
0 M; d0 [. I, R$ H- D! Q* B        wait for A_time sec  Z( g7 c) k& W8 i
    end4 g! N4 t+ K# F$ O4 r
end
* f) Z7 a7 P; C1 I0 E% \2 P3 L' L  X/ i  J. l0 A  e
begin P_induction arriving
9 S* b5 U$ Y: |( `2 i    if A_induct=1 then clone 1 load to P_pick1( L$ A5 a7 c  m- F. f1 ]2 z/ `% c5 n1 A
    else if A_induct=2 then clone 1 load to P_pick2
+ b& y0 ]! G; l) \, X$ \        else clone 1 load to P_pick3, ?9 l, L0 c  p5 p
end" E7 H4 J7 d' E1 A

, _- i. y0 v0 Qbegin P_pick1 arriving7 q2 O% y  G# k5 W! _" [& I  f
    set A_i to 1
% z/ w/ A! |/ d" _2 ~, f    move into Q_induct1+ e" G0 _2 H5 k; b
    move into pickaisle.induct1( q# j: b8 o3 Y
    while A_i<=30 do begin" ]1 R3 N' b9 N
        travel to pickaisle.con(A_i)! N# S  U& l* [! |; H  r: Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& R" J' L* U# t& t# C& o( c        else wait for 10 sec
$ r( B$ Z' f% ?$ t        if A_i=A_leave then send to die& W2 V! L$ H5 p
        else inc A_i by 1
4 j+ `! u) Y' @8 l: V    end
( T! k8 O! r; c5 {, uend: S6 o" c' F) f3 @, l4 W
0 Q. w4 {7 E. v, T& ~! u
begin P_pick2 arriving+ [6 D; ]. O- O/ K+ Z0 r1 n
    set A_i to 11
- G$ p3 C/ q1 R+ T    move into Q_induct22 w) r4 _3 B( v+ V8 l
    move into pickaisle.induct2$ d6 H& U! p' p! I) P& |: X
    while A_i<=30 do begin
9 T5 }  f9 e( I        travel to pickaisle.con(A_i)
, Q2 [6 h7 ]% H4 W9 Q; o0 f& w% s$ F# W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- G" `; P+ }- b/ ?# g8 n! f5 l
        else wait for 10 sec5 u6 E: d% c1 n
        if A_i=A_leave then send to die
9 y) A7 f# k) o8 d$ `        else inc A_i by 1! Q. s9 L$ \0 y
    end
$ x: ~- J) R& dend9 L) A3 r/ A* a& o4 e( X( r/ O

/ l) q: G% H. @8 @% vbegin P_pick3 arriving
; y& X0 _3 A$ h" v9 P    set A_i to 21# y& M% F0 i" V" Y( w
    move into Q_induct3, P, Z- D8 C% d' H' f7 a+ a
    move into pickaisle.induct30 W" i1 x" R7 |# ]9 I& K( |
    while A_i<=30 do begin% |2 q7 H- D4 b6 L6 f0 e
        travel to pickaisle.con(A_i)
! C5 T0 D8 N7 S. ]+ w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 R0 Z; P  \% s1 i' ~, T) m
        else wait for 10 sec5 ]( G( E. ?8 ]
        if A_i=A_leave then send to die
' V+ D( o6 Z, R% R        else inc A_i by 1
4 m- e# k7 x9 Q5 t$ p    end
$ t% q$ I7 c2 K4 J5 M. ?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 u5 n& o& ?& u8 e- P
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( Y" x% @* f; ^) J) [8 J

2 L8 |& O$ \5 Y' W6 EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% U9 Y& W, N5 V8 b: f6 W

- [" Z3 J4 O$ N" n) t! `0 ^; W' R另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  k" M$ A3 h- o; L; q+ F1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 n: Z* h0 }" n" f  z6 B# \* }
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, T, z7 t# H- }, V
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! y9 P4 O% b" [3 l/ ?! D) Pbegin P_induction arriving
' k* X8 U) m8 D1 q) T) N9 U0 ~    clone 1 load to P_pick(A_induct)
2 r5 _7 e1 ^. Y# d1 aend最大的系
* A3 z3 U) c" i$ P0 u6 Z4 }' Z: _! A+ y; N  m. D/ v
begin P_pick arriving
$ M9 n" D: G" y) U, p( i    set A_i to procindex * 10 + 1
, p3 c9 R1 U$ q/ d* x0 O# n$ l/ s3 F% ^    move into Q_induct(procindex)0 z' c# r4 O9 q1 z9 I7 [; J2 }7 P
    move into pickaisle.induct(procindex)( z1 C) v9 W& c: V$ K: M/ y! K- \
    /*check the type of pickaisle.induct(i), for your last problem.*/( x& `0 x7 a. d

. f" Z7 l- Q4 N" ~    while A_i<=30 do begin
5 D% u5 Y/ t4 q' h! U4 }& R        travel to pickaisle.con(A_i)
" _7 h% H. U' o6 V8 O" m3 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( a+ b6 D/ ~" {" K& o- f        else wait for 10 sec" \# |' ?9 e  h! N  F
        if A_i=A_leave then send to die
' `' e. ~; {7 j. C  F        else inc A_i by 1% R0 g/ b0 ^2 _' M+ J
    end+ R8 _- U, m$ P% |
end
9 ?) r' F0 z) D4 J7 q, b+ I# L
% o" h3 c; H% Q其中的procindex为整形,代表当前process的序号。* C, W+ u0 Z$ c# H# Q' t* L
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-3 09:49 , Processed in 0.014405 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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