设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13423|回复: 2

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

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

$ j, W. `( T+ C/ }# d5 C: c. L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 N6 ~" n6 n0 j$ r- `, F3 M6 C2 Q  I# M! h/ W3 t
begin P_read arriving2 b8 m" c- v. I, C  R% G* k" H+ z
    while 1=1 do begin0 o( P7 d! Z$ s  b0 A- Q
        read A_tote from "data.txt" with delimiter "\n"
; ?5 ~+ v% }0 P7 w3 O. r        read A_time from "data.txt" with delimiter "\n"
: j5 T0 `+ G) n( m! h/ D, H        read A_leave from "data.txt" with delimiter "\n"  F9 o3 g6 }3 s" u2 B
        read A_picks from "data.txt" with delimiter "\n"
1 g8 L: d$ T  w4 o6 B        set load type to A_tote
1 ?- W$ j+ T6 }) q1 Q+ c) Q        if A_tote="tote 1" then set A_induct to 11 r8 D1 \) _- i0 g
        else if A_tote="tote 2" then set A_induct to 2' O5 y8 `& Z1 G' U
            else set A_induct to 3    3 W; n2 s+ I9 V  l* A
        set A_i to 0& y! U; c$ K+ o1 s
        clone 1 load to P_induction
- I% y; u. j7 `        wait for A_time sec
: c* r$ ]/ ^3 `    end) E+ o( Y, n1 z6 C
end
3 x; _; @* H: m. S
4 t! Q3 U7 O: A* p( ~) @9 j) f- ebegin P_induction arriving" L+ r* t" d$ p9 Z
    if A_induct=1 then clone 1 load to P_pick15 r- X+ v( o6 r0 U% Y
    else if A_induct=2 then clone 1 load to P_pick2! c2 f7 K# |$ ^: Q
        else clone 1 load to P_pick3
% N& H0 x, p7 o) R. q; t/ Q; rend& W5 U$ i' Q- f) C$ x
# I! Z& H& ^9 q: P% M
begin P_pick1 arriving% |- [' P- [! r$ }6 O( q. H
    set A_i to 1
- y: x* l3 u5 ~! t( d6 p    move into Q_induct1% B1 p; k/ S' u2 {
    move into pickaisle.induct1
' x, e7 i8 R; {. l, y    while A_i<=30 do begin5 _) r3 B% `( f% J+ i& z$ M
        travel to pickaisle.con(A_i)
% q% h6 p% i4 H' g. Q' v7 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ?5 y2 e6 ]( f/ L, p9 Z
        else wait for 10 sec2 w) D# p5 t( p5 r
        if A_i=A_leave then send to die' u; T3 h7 b% p5 m3 v. q: Q* O
        else inc A_i by 11 P0 L$ j/ z' T  z7 P( V
    end
) \0 E) z8 {7 U: A0 ]end
! J2 P, C7 K& G% J( G: [% P3 \3 p6 B2 ^! l: M/ g" Y$ ?
begin P_pick2 arriving/ H6 b; M9 v% P+ s7 e" H* o* @' N
    set A_i to 11* b8 y. P4 s) T
    move into Q_induct2, F! N$ g0 [3 F  c: B( U5 F# ~
    move into pickaisle.induct2* M% A" [, j9 h/ r
    while A_i<=30 do begin
1 F$ K& b: d  h! O9 n" s: G        travel to pickaisle.con(A_i)5 y# e. m- u  J+ e/ z9 G+ u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% a- K$ N! Y! _2 n+ ?( s        else wait for 10 sec, @+ Y: v, m, u4 t
        if A_i=A_leave then send to die6 I4 ?5 M/ Y6 c; U- E
        else inc A_i by 1
, R: ~* N0 j1 O6 n1 Z/ X* Y1 c; d    end
( o% i: n# ^' z# v8 B$ w# D( Fend
4 y5 D% K. r( a: a% S7 j3 @' k' o+ Z  H. \: A6 C- \
begin P_pick3 arriving  P# C% d4 P" u% g
    set A_i to 21
# _' C3 L, s2 l# R    move into Q_induct3* c( ^1 _$ c0 ~, X8 z! V
    move into pickaisle.induct3
% }5 j! @- k7 z5 R    while A_i<=30 do begin
) w( W( ?! G( d6 l0 C4 t, h        travel to pickaisle.con(A_i)
3 j3 q) J2 i8 [  O# R0 V$ u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 m1 w$ H/ P; i( s9 m
        else wait for 10 sec3 g' q  c/ B. o+ s$ d" j/ R
        if A_i=A_leave then send to die
- J2 ], u# G) j! t. @- h        else inc A_i by 1
4 w5 U* e5 z* `( ]6 W    end
! ?) c; y. R6 z# Kend

最佳答案

查看完整内容

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是个什么东东?
, }: X% z0 H- ]8 k- i  cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ e8 f* {& a0 v+ Q
: s9 u8 P- q3 ?9 G/ B' {( l+ wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. f1 b1 \5 T7 o( C; p/ U* X  O
& Z) o# S# G8 Q" G9 r5 P
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 [: M: ]# q( u( h4 G) q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# ^+ c1 N; U' Z; N4 P2 |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 n! }2 `; `- V0 Z# T& K" q: f% t- {3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! U" V" E8 `! s0 }( _, bbegin P_induction arriving! u5 o4 e' C. {5 J
    clone 1 load to P_pick(A_induct)
1 c% J; l, f3 F9 ^end最大的系
7 i5 f! C/ g9 K; O- o; J
/ W9 Q1 m( Z( Y+ E) ]9 D) ]begin P_pick arriving
+ a  b9 `2 t5 K+ |5 i, b    set A_i to procindex * 10 + 1, b7 ~0 j5 y8 `- g3 c
    move into Q_induct(procindex)2 Z4 ^, k. U3 e6 C: _# y0 @
    move into pickaisle.induct(procindex)/ H5 b- o6 z5 L) Z
    /*check the type of pickaisle.induct(i), for your last problem.*/
% q4 o6 l5 Q+ M# J: |; ?  {! F7 F- m8 }
    while A_i<=30 do begin
& D, P, P4 ^4 w5 N- k        travel to pickaisle.con(A_i)
' u3 n( R% W% t7 @, _1 x4 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 T# G" {* F7 ]- ]# B5 Z        else wait for 10 sec" j+ a- Q1 W# W0 y0 I$ q6 @/ _
        if A_i=A_leave then send to die1 A5 Q5 S- \9 W8 r7 B' L9 Y
        else inc A_i by 1
/ h/ M4 Q$ w. S& i* A    end+ x1 o) T+ `/ N" b" \
end
# h$ E" Y: f9 N5 T( h7 @% e5 a$ `5 I  L1 D
其中的procindex为整形,代表当前process的序号。
$ z7 Y* Q* `0 k7 K7 t& L& mstation和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-4-12 17:13 , Processed in 0.018294 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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