设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14356|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* x( i1 K; i: I7 {
  f- y, T7 d" c- {* k7 S我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' Z: V) Q, a" x; B4 y# o0 A4 _  o1 i4 I7 J  J
begin P_read arriving
( ?1 W4 ^% ^  N2 \7 V  R; v    while 1=1 do begin
/ K( e2 K( q- {  V        read A_tote from "data.txt" with delimiter "\n"- x, H# k# @) a
        read A_time from "data.txt" with delimiter "\n"1 B, ~' T  _; F1 \6 T4 _" j
        read A_leave from "data.txt" with delimiter "\n"
% U  h( T6 \, _4 F  Z        read A_picks from "data.txt" with delimiter "\n"
; Y6 z7 J/ D7 {7 P5 b' {9 J0 q        set load type to A_tote2 l) A( ?4 J2 ]+ [
        if A_tote="tote 1" then set A_induct to 16 B, v/ t2 i7 x- r; I* }. A; F
        else if A_tote="tote 2" then set A_induct to 2
3 u: H! t9 T/ Z4 M& b% m- j) W: N1 z            else set A_induct to 3    : G9 g0 t2 H# z
        set A_i to 0
$ w% `/ W% U7 c+ ~, ~        clone 1 load to P_induction
6 q) }* p7 o, W$ A        wait for A_time sec1 W! B$ |3 M/ [8 k- n9 t
    end
* `/ y2 J# D, x1 L) h: g1 v! lend/ D% B- D5 D* n/ A
9 `9 d- ], f, ?' k+ f, E$ p
begin P_induction arriving
+ Y( \. j( b* N" d    if A_induct=1 then clone 1 load to P_pick1: f# [% H: B# g0 N
    else if A_induct=2 then clone 1 load to P_pick22 y" s) U5 G% l
        else clone 1 load to P_pick36 ~* M, C# k+ u3 |% G4 }9 M9 a
end
: a) ^2 N: A& V' Q$ b& E
! {$ n! V4 b# V9 o' Z% [$ m+ Rbegin P_pick1 arriving* o3 _5 K& K) k2 b9 a7 `
    set A_i to 1
- y- o/ x  g, u- _    move into Q_induct1
3 J( {0 M. B% R- b  y. ~    move into pickaisle.induct1  D9 w5 b5 U- g
    while A_i<=30 do begin
2 V1 w8 u  |# ^7 q8 K1 U, `  \        travel to pickaisle.con(A_i)8 X* P; P9 M( }. T/ [' ]( U, k* o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 G5 @% a' f8 l2 R. E  c# O
        else wait for 10 sec
+ j+ `& {# n8 }% J$ d- m0 g( w4 D% j        if A_i=A_leave then send to die2 \$ d5 g, ?( D# g' b
        else inc A_i by 1
% ]# U- ^$ a- {) f& B( @0 B* o% C& {; F! K    end
* H2 k5 T& W* d, C3 L/ Eend* v% s0 K2 P1 f. Y
$ {, H, y9 K; S. e) o. u
begin P_pick2 arriving4 ^/ q+ p6 B- H; q
    set A_i to 11/ a; q1 {  Q. [0 C
    move into Q_induct2
* j/ j2 O9 P' @, n. [' V. H. k    move into pickaisle.induct2
7 W  l8 {6 u( N/ [: z  \- J    while A_i<=30 do begin9 \+ |# Q. G) g  ^  `+ u8 |
        travel to pickaisle.con(A_i)
2 f" @1 T% `% f- K- n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: B7 L1 ?( f0 g6 }- D0 M        else wait for 10 sec  g5 [7 M) ]+ k0 {
        if A_i=A_leave then send to die& e1 B% [9 g- u  @, P' U
        else inc A_i by 10 J. ^! j' n( {3 ^
    end- y& a1 ?: P8 `% v: R" C0 p
end+ X& W- `4 u: g% A3 d
! r# U  @8 L# J9 Z4 W$ q9 ~
begin P_pick3 arriving) n" u9 N& e6 C$ a4 }9 T+ W
    set A_i to 21
4 q* L( z6 s8 r8 B5 v" l    move into Q_induct32 K' N; L/ i3 J; b, @+ I  a! s
    move into pickaisle.induct37 T& S# b( v+ z9 L
    while A_i<=30 do begin; n" Y+ _0 o, V! n0 d/ v
        travel to pickaisle.con(A_i). |7 t$ v4 B7 V/ j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 J" h0 @4 b7 ~& W3 D. X# v        else wait for 10 sec) ~  k9 O9 u( Y! f# K3 l& x0 f
        if A_i=A_leave then send to die1 X2 A) z) e' J6 R
        else inc A_i by 1/ Q8 D  h" B$ |- |. S
    end' H' x5 a& Z7 i) a  _
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是个什么东东?
0 Y% d5 N+ \/ C$ M2 ?" s8 Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 a0 a' W' t  }) X9 l% L8 h5 B6 j7 c, U1 o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 x2 m9 L) h! [, n9 E

  g! j0 d* I* a9 J. k7 c( K% c另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- c3 ?+ p' r* I1 `" ?1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
8 E, R9 i0 Z; H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% @3 f( B4 _$ \! E" b) v- q, {3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  a# }3 s1 X9 e3 j7 M  F& Abegin P_induction arriving
" p+ U6 Q$ ~# w' W    clone 1 load to P_pick(A_induct)
: m8 q5 D6 e3 T7 D4 Send最大的系/ e0 s  `+ u9 P
- f* M; r: o9 x
begin P_pick arriving
; ^3 t. F% I& I: J" x0 ]) [2 R    set A_i to procindex * 10 + 1
  \- F1 D' M3 E8 _3 d$ b    move into Q_induct(procindex); q2 }6 R7 n+ E2 L9 e0 Z( t5 Y
    move into pickaisle.induct(procindex)/ f- Q7 `' G( n' X4 ~! ?) |
    /*check the type of pickaisle.induct(i), for your last problem.*/' U5 U2 I" X' a5 V) j$ b
) N# {: s. o- l! Q  B
    while A_i<=30 do begin- Y6 s) Q; {1 E3 A& N, t
        travel to pickaisle.con(A_i)
# h8 G6 Y0 n' |* P; C% J# Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; i( C( b* M; H* X* E
        else wait for 10 sec- I. x" ~" p# C$ `$ E( N# L
        if A_i=A_leave then send to die7 n. B7 v5 V2 E  c, a2 P; s
        else inc A_i by 1/ x# H2 I* ]. [' g% c
    end
: F9 [$ Y% ]. }8 B1 |end' c) |/ Y7 }' J

0 }  M6 k" }5 N$ p8 B, f2 p+ p1 ~其中的procindex为整形,代表当前process的序号。
' l8 T5 D* M1 p% Z0 `1 Gstation和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-7-5 18:21 , Processed in 0.014078 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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