设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12601|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! J' h3 ^5 W/ J* S
( b$ C$ I* s) m5 r( ^0 Y' _# U我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: q/ d+ r0 Z) M3 O- ?" H) x# l1 t1 x5 K/ C( X
begin P_read arriving
0 f0 C# K! |$ i( K" Q    while 1=1 do begin3 ~8 `" ?$ i; D/ S
        read A_tote from "data.txt" with delimiter "\n"; E4 m+ F2 w/ ^' j+ l$ J
        read A_time from "data.txt" with delimiter "\n"
- D6 f" i2 n3 X' k        read A_leave from "data.txt" with delimiter "\n"
( l3 V+ \6 D; v1 S" A        read A_picks from "data.txt" with delimiter "\n"
0 k5 h3 G: ^- ~) C        set load type to A_tote
5 U; v2 W; {( d        if A_tote="tote 1" then set A_induct to 16 E* d" ]7 u- S0 H3 ?# J
        else if A_tote="tote 2" then set A_induct to 21 T  w. @2 @8 f3 ]+ @6 [
            else set A_induct to 3   
1 W# [8 ?8 ^3 O2 J, \        set A_i to 0
! e4 I( g/ V: e& u        clone 1 load to P_induction4 ^# d2 i  q( n4 J3 I7 A
        wait for A_time sec3 j9 J* [; V6 O4 i* A
    end
+ p% y/ }& A& m: O4 Z3 t3 jend) @( C4 f+ Z/ G$ b* y4 d! n% O) w
) r" e  F& h4 C& I
begin P_induction arriving) @4 O0 u0 `  g9 N- Y5 @7 x& e' W
    if A_induct=1 then clone 1 load to P_pick1( m6 R, B6 U: F# V
    else if A_induct=2 then clone 1 load to P_pick2% m: k* V* C% u7 ?0 V$ h
        else clone 1 load to P_pick33 p' S2 r7 p! }) ~! ^; ~8 Y' j% a
end
9 K* |$ ~9 q, F5 h# l; ?0 \& ?& G: ?6 u
begin P_pick1 arriving) [% b) l$ {9 ]) |
    set A_i to 1
; E8 \& _5 g! f' E; t  J1 {; n% x    move into Q_induct1; M9 B; j' p3 D: m) W
    move into pickaisle.induct1& M% Q. R0 t7 I! h1 o# d
    while A_i<=30 do begin
& C5 j( v! S! a        travel to pickaisle.con(A_i)
% `: _2 `1 R5 g+ x% k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [7 h: O0 x5 {( V
        else wait for 10 sec! U0 G# }0 s/ ~. s1 K( \# D
        if A_i=A_leave then send to die
- h- ?8 @/ z; A  @        else inc A_i by 1$ ~. g; Z. N, s8 j! v4 G+ U
    end
- X3 V. n; h. r- U5 L; A! `% v2 i" Aend7 ?# A9 o* K$ s8 y  m; S; @

3 K6 m1 Q& Z- _8 j5 ^begin P_pick2 arriving/ M4 [) n; e+ d: s2 y  E) G9 D, m
    set A_i to 11
: v; {" ]# U2 E% o9 S9 S& A2 V( s    move into Q_induct21 W5 }: L$ @- b+ a7 i& O
    move into pickaisle.induct2
: i# z2 f/ t: Q/ T! V# z& q    while A_i<=30 do begin
  w$ Z7 s/ T# T" V9 Y+ J3 I        travel to pickaisle.con(A_i), |  R# `! j( j8 S' Q) P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 o4 \( Q  k! w( z  ?
        else wait for 10 sec
; l1 [/ W* K( P! p, U/ D: q4 f1 ]        if A_i=A_leave then send to die$ K& j+ l( b( v- m5 S' m; C
        else inc A_i by 1
# G1 }0 d) m  I0 B3 R6 K2 x    end
2 m  b/ B* _, v3 I/ @& ]) Iend
2 v% L3 w- Q8 B6 z: B! \
7 c. }- w; B8 T' b6 C1 n& q1 rbegin P_pick3 arriving
, C% n) v7 w) i0 Z7 u6 k    set A_i to 21& C/ U9 O* Z0 O8 ?7 q9 E
    move into Q_induct3' x2 W3 q' @/ y1 L/ X, W
    move into pickaisle.induct3
9 S& c, d/ a1 l/ h5 |! R    while A_i<=30 do begin
: N; I# l# g" \# J$ W  r( `        travel to pickaisle.con(A_i)4 t$ x; F" P+ Y! x: ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  T5 A. i9 G1 U) H7 V- E5 C0 T        else wait for 10 sec
+ G3 m& ?! {* s: h- z        if A_i=A_leave then send to die& A) d( Q! S+ I+ u5 u0 s) V$ O
        else inc A_i by 1
& |# K, o& Y2 K( O# I. ~    end2 x( y. n# \3 S  W$ n
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是个什么东东?( F' c3 t0 W: [# V
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. t: t: C( ]: V- `  Q$ r3 k
8 @  {9 b1 v1 i, P' m0 {: ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 b& P; `& ]5 C1 P
  K$ q0 r5 B6 V; F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: U5 `0 e% o& W' M
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) M9 y/ O, H$ M. p" _2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 L. U( X" J9 V8 o6 I1 M$ W: ?" X3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; n' [2 c5 m5 D+ ?% H3 x
begin P_induction arriving# k& O2 N# G) q6 K3 }$ i7 T0 l
    clone 1 load to P_pick(A_induct)
6 o% e# T& m5 }7 [2 iend最大的系* ]+ _' T5 D& o3 i! d
4 u7 p' E# ^8 H9 @( L  q9 |) l( z
begin P_pick arriving" n# V3 h3 v9 w
    set A_i to procindex * 10 + 1
5 W5 C" [# Y7 u    move into Q_induct(procindex): j4 w/ l2 Z8 F2 e; @& D$ E: w: x
    move into pickaisle.induct(procindex)
# N8 R  B8 ~' u    /*check the type of pickaisle.induct(i), for your last problem.*/! E7 z4 f4 e) ~+ q

8 T  i" O) k4 A" h5 y) [) x+ j3 S    while A_i<=30 do begin- _4 u1 p3 p1 x. p
        travel to pickaisle.con(A_i)
/ J; S) ]5 X) S% K% q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 `" y+ \9 }, m# r* C& z; X
        else wait for 10 sec( i) A7 Q( P; N+ P% v
        if A_i=A_leave then send to die
% s' e. q  L. W9 x, U        else inc A_i by 1
4 [/ d0 Q: {3 Q, j! o  ]4 M) h    end8 W; z5 W5 {- ~2 y) P9 q2 t
end
8 [" I, X/ ~/ Y. F8 o9 ?0 C- U$ ~$ V2 J. W* Q& `" D- I
其中的procindex为整形,代表当前process的序号。
$ _0 V7 J/ |; Q# dstation和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-2-3 20:54 , Processed in 0.014377 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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