设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15180|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 i5 M7 p5 J+ ^) D. h! I
* q) L+ g% C$ Y7 O/ W我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" |4 g" k$ B" W% Y& H* T. l) m7 X3 t* i) k5 p) P
begin P_read arriving7 l. @3 O+ P# k, m
    while 1=1 do begin
( `0 b8 k; `0 K/ h7 A. s        read A_tote from "data.txt" with delimiter "\n"5 C0 A0 k8 B, t; v* a) A
        read A_time from "data.txt" with delimiter "\n"
: e2 F/ _3 a& @9 c" T) m        read A_leave from "data.txt" with delimiter "\n"& q+ N# |4 z  d# s% a$ z
        read A_picks from "data.txt" with delimiter "\n"
6 U2 \3 ]/ ^8 \1 E. t        set load type to A_tote+ h5 X1 Q7 o" n2 Z; X
        if A_tote="tote 1" then set A_induct to 1
9 Y/ P# i/ G' `0 \9 W; C) \        else if A_tote="tote 2" then set A_induct to 22 B' ~: F3 a8 {8 W9 O7 Z( X
            else set A_induct to 3    7 \) j& O  [1 a# ^* v# _
        set A_i to 00 Q5 M) e, T; W* i1 y& g/ a0 _' j
        clone 1 load to P_induction
, _5 t. ~* ^2 \& R7 s9 @  f        wait for A_time sec
" l# `' Z: G( s# {0 J$ e    end
/ j- t  H" o1 R8 H! @. E$ cend
) x0 F/ k! e2 \' V8 R0 i, [8 X$ B- _$ Y* x" a
begin P_induction arriving; O0 V2 P" r$ |
    if A_induct=1 then clone 1 load to P_pick1  f& C5 c: L& N3 Y4 k& x' \* F8 U
    else if A_induct=2 then clone 1 load to P_pick26 t& B1 G+ ^( T; g7 [
        else clone 1 load to P_pick3
: u+ m# ?0 o" P6 Y2 Y! [1 _& [end
4 J% Q9 i4 Z1 z% O, z  Z0 b* X1 ?- g6 Y% L# g% d  U5 B
begin P_pick1 arriving" A& r! I8 P4 p- z; _& ?  y5 n5 e
    set A_i to 1
, [  M: z; L6 o# n/ b! z5 _    move into Q_induct1- l! F, {% N7 \6 D# `2 D3 z. w
    move into pickaisle.induct17 o* o1 e+ @3 K
    while A_i<=30 do begin% f! I8 w) ^) b6 e& }" N5 w' J) T
        travel to pickaisle.con(A_i). e0 H* L/ ]/ G6 |; g8 w) X, c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ \& f- \# }& t. G+ |+ i        else wait for 10 sec5 f* M2 G8 `) [5 l) y$ r8 V2 P9 v
        if A_i=A_leave then send to die# m; O3 T+ o" t- h
        else inc A_i by 1
4 d- x* B: @4 B! J- G5 R    end5 G9 `- M; w  E
end( _2 _4 G7 U* [9 I! }2 |1 z
( H5 o8 L) V8 r& t
begin P_pick2 arriving
6 @# T7 |* i( t0 ^; ?! ^    set A_i to 11
$ i2 _+ F9 \1 {+ T    move into Q_induct2
/ ?6 h! e/ K& l9 T( g    move into pickaisle.induct2
7 ~' x5 I, f( a' l* H) G    while A_i<=30 do begin
9 \: a! q/ h7 s6 P: P8 t' J8 t# w        travel to pickaisle.con(A_i); F! o# u, g% m# r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( y. K9 j# |8 j+ }        else wait for 10 sec
' y- a' l8 E$ f        if A_i=A_leave then send to die
7 @. t! X0 ?3 m& @        else inc A_i by 1' P0 X3 B! ]! ?8 \' {+ T
    end
& ^( `% q9 `+ j; J+ A, fend
/ B% R9 P+ W3 p4 {
% Z4 b8 K  |1 c% i- jbegin P_pick3 arriving  {2 w3 |; k9 e( G% \( U
    set A_i to 21
% P# R  V) A9 X    move into Q_induct3
1 K' h. A. Z" p  \    move into pickaisle.induct3
- E# K8 V/ d; P    while A_i<=30 do begin
- D, |- E# @2 G+ s# s+ n# h        travel to pickaisle.con(A_i)
, b9 Z1 _/ t3 w8 N2 b* Y& n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  L2 ]5 f3 e" }  r1 E( v+ Z
        else wait for 10 sec
: m. j! {8 u* X  e9 d        if A_i=A_leave then send to die5 Z7 ?. b3 \1 f2 E0 R$ e
        else inc A_i by 1
# w. g! O5 `/ ^4 k    end0 }  F. L3 g9 E# \  O
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是个什么东东?  K4 U( d# R- Q$ Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" [* N+ N' \8 n1 k" p1 ?! P
" s2 }& ~1 x) k# x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 P4 m. M. l% Q& i. a. p- F) @3 |9 g$ x
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ R+ N9 K7 b. h& l1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 l' ?0 b) I  o+ x& J$ p; n2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: K6 |$ s5 ?8 n1 E- Y9 F9 [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- E7 K# D4 @8 c. n( Sbegin P_induction arriving
9 o( [: J  [; q8 m    clone 1 load to P_pick(A_induct)
, b- ?/ E( U8 z: [# E8 kend最大的系. Z- ~6 R7 R1 S* j
4 r6 c0 S0 J% N1 [! ^5 j; K
begin P_pick arriving
0 t1 p0 S5 l  A: u$ d    set A_i to procindex * 10 + 1
, y7 w5 M$ X3 q2 p4 G    move into Q_induct(procindex)3 I/ ~/ ~1 _" K, U4 N
    move into pickaisle.induct(procindex)
& w) ?5 t/ |) x- T+ h3 E    /*check the type of pickaisle.induct(i), for your last problem.*/
; k4 m4 @, T# y3 w+ r/ R
2 J0 V7 k7 l" O( |8 ~    while A_i<=30 do begin
5 z6 T  Y& A6 |9 t2 g+ D( v        travel to pickaisle.con(A_i)
* j1 Z" Z6 u( p% Y8 y+ }! V+ n/ s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 G! |. }# z+ b; ]( e' Z5 p
        else wait for 10 sec) M0 W% b, ]! r0 H+ c* q! A2 V0 I
        if A_i=A_leave then send to die  J0 C4 C- V) V( n
        else inc A_i by 1
9 ?/ q6 c" Y2 S5 T9 E7 [    end
) h0 D) S$ y4 J& }$ `% Wend% n4 `% I7 i0 u8 Z

# b( u; V/ i; C2 y+ O) |4 W其中的procindex为整形,代表当前process的序号。6 e' B+ M0 x6 W& j, }0 s
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-8-20 09:59 , Processed in 0.020952 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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