设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13838|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% F1 c! f7 v0 m& ~7 V6 ~5 D! Z

) k" Y, m2 E! T: t. 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中的数值,不知道会不会有什么不妥。
1 g3 d( P7 ]( x# u9 Y' F, Y4 e6 R! l
begin P_read arriving
; _- @# \) V+ q4 @    while 1=1 do begin( g. r# G. B& J1 @  ?  u# v
        read A_tote from "data.txt" with delimiter "\n"; g2 U# C1 ?$ B- V* o4 @
        read A_time from "data.txt" with delimiter "\n"
: J. i% Q2 v. q  o  ]9 M" i1 ^$ i9 L" u        read A_leave from "data.txt" with delimiter "\n"8 m: K6 g9 W* j+ G
        read A_picks from "data.txt" with delimiter "\n"
2 @0 @3 Y! j% j4 B6 D        set load type to A_tote$ o* M+ P+ t8 E; T0 Z; V/ E
        if A_tote="tote 1" then set A_induct to 1
3 p) T9 D( q! ]& ~% L        else if A_tote="tote 2" then set A_induct to 2
( ~3 U9 R: \+ G+ d% C7 \            else set A_induct to 3    * J' C% p- A7 v( s3 {# c% ], r
        set A_i to 0
2 C* [: U9 w( |2 b8 g        clone 1 load to P_induction; J+ J+ J0 m$ {
        wait for A_time sec' d1 i9 y+ l+ T- s& ~: `8 [
    end( ]8 Q2 Q/ s- V: Z' p
end
, K1 Q5 y+ m3 ?* i
5 S6 _, e0 X8 U7 X+ Mbegin P_induction arriving( U/ U/ I1 r1 a- [, C6 C+ Z; Q
    if A_induct=1 then clone 1 load to P_pick1$ w# @' V) u) s+ |* t$ _: k$ K
    else if A_induct=2 then clone 1 load to P_pick26 z2 n6 F+ ^2 \
        else clone 1 load to P_pick3
6 `( g4 o2 g) ]$ g. l/ w! e& x* T3 zend+ t' e: b- |# O; x, s6 }7 S4 s
1 D/ c2 L' v% T/ R' T# W
begin P_pick1 arriving) ?1 v$ U9 K. i& z2 _- A: ]% {5 h
    set A_i to 1: O' L- e" F+ @* j. p, H) J
    move into Q_induct1
, u" m6 c  `6 h4 U9 P    move into pickaisle.induct1  h# p% t- u+ B& w: T3 o! A
    while A_i<=30 do begin
1 h& d, `$ T, h- P        travel to pickaisle.con(A_i)! W% G$ X* {# N# d# Z' L! Y* V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- v6 N2 S, X1 q% V# L2 s) r, E6 u        else wait for 10 sec
7 x" Z( g0 h" M        if A_i=A_leave then send to die
# R' A/ R8 u) D$ e( m# h$ H; _        else inc A_i by 11 `: N- s$ x, B$ ]- |/ s" Q
    end; H% c( _( m9 l
end6 Y1 g5 V( P. [
; T% @+ y- A, ^! }- M
begin P_pick2 arriving
( i/ [0 [& F# g0 |4 l8 I& C3 v    set A_i to 11( [: v; {6 g( U1 n; |7 M+ L; R
    move into Q_induct2
9 R: s" A9 T$ ~; j2 ]/ ]" E    move into pickaisle.induct2- I/ ~3 U$ H/ R2 y% H) A0 l
    while A_i<=30 do begin
" k- V3 b- z  u. V) V        travel to pickaisle.con(A_i)" L9 x0 e4 |# o* |9 }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ]# [2 W2 h9 g/ f; p0 ~        else wait for 10 sec
- L, w3 N- }8 M0 {8 o6 d4 x        if A_i=A_leave then send to die
  l9 h: l- b! m: l. M" v        else inc A_i by 1" {3 f, s1 S& w7 j9 k
    end1 V7 l/ ~' O& i8 \: ~* o6 E
end
+ {5 P: [! f6 I
4 V& Z4 \' x; j3 Y, D: bbegin P_pick3 arriving2 z  C; r1 H1 s. v
    set A_i to 218 C/ Q- j; i0 @4 m; n! W2 x
    move into Q_induct3
9 C, c* }" o0 I. R  N1 T9 A    move into pickaisle.induct3& c9 m$ v$ i0 c; d3 i/ q
    while A_i<=30 do begin, L) q, C& y1 X9 y3 s. Z6 G7 x
        travel to pickaisle.con(A_i)( i  `4 e9 h- D8 y$ p4 R6 t9 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. o: J$ j! Q( ~1 N6 t! }        else wait for 10 sec  c" ~9 O7 [0 r$ b& X
        if A_i=A_leave then send to die
; R! H1 J: N9 h        else inc A_i by 1
9 [* |4 t# z. \    end; i% r0 d2 f2 q6 B0 ~$ h$ ~9 g
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是个什么东东?5 t6 u8 P2 ?' o/ X7 q" S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?4 `+ C( n% {& V/ m5 [

; X; e  Q! Q& [+ i* Y8 c/ Z( Z$ bAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 T# T& L) d  b/ `4 ]
# k- x* C/ k  U$ t7 u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
* w8 s3 }: b, s, _* U( P0 ?1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 a$ Z  ]. Q3 K$ B2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% B6 U' ~* F+ c! W# B3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 }1 {: Q9 b3 D# V- N  U5 }
begin P_induction arriving' U+ ^5 O. q9 [9 A, L) [& O! t# _$ D
    clone 1 load to P_pick(A_induct)
' a* ?" C# D% D- ]2 T% N, {1 Eend最大的系
, w  e  p& b0 ~  L. O
$ @4 ~+ W+ O1 k" ]. [) s2 Abegin P_pick arriving9 g& h) \. c# u# Y" I$ q
    set A_i to procindex * 10 + 1
! d& X& r8 c9 U2 e    move into Q_induct(procindex)+ u) L# V# t: ^5 M8 E2 W$ b
    move into pickaisle.induct(procindex)( z8 c1 h# O6 O1 }
    /*check the type of pickaisle.induct(i), for your last problem.*/0 |2 z, r2 M; X! d2 k
- h: Q6 u: n/ S1 t) w8 M
    while A_i<=30 do begin
# l5 F. o6 h' x# T        travel to pickaisle.con(A_i)
& o9 M6 Z9 g: U# Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 u, H, f8 _: ~6 v        else wait for 10 sec& q8 O3 ~/ H+ F7 b8 C
        if A_i=A_leave then send to die! U, \* C. P: i1 P; Y# Q# O9 g
        else inc A_i by 14 i$ ^6 T$ O% e+ U* N& H  C
    end
( R- N1 e. G( P/ J" Wend
# E% Y; i% r6 T! Y9 @0 K
* G+ K  b2 z4 e% a: I) F其中的procindex为整形,代表当前process的序号。. E5 o2 [0 b/ P, |1 n( `
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-5-11 07:03 , Processed in 0.022102 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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