设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10473|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! ^% E- w. ?& L! M, B( |
# B7 N: A8 Y" z" S0 X, e4 C  _" ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。  k- G9 j. m1 O/ l
+ e( Y& j: J) o7 I" h2 ?  [
begin P_read arriving1 l0 j3 _% o& @5 i1 v9 k4 c1 _% M
    while 1=1 do begin
6 ]! t9 `5 l4 T) n) ]        read A_tote from "data.txt" with delimiter "\n"
$ i4 {: i2 O9 {* C3 C6 U  l, G        read A_time from "data.txt" with delimiter "\n"
3 a) u+ [  d" G; ~3 J        read A_leave from "data.txt" with delimiter "\n"$ ?  U# ^+ Q9 d4 z
        read A_picks from "data.txt" with delimiter "\n"8 L7 n' P2 w' {: C
        set load type to A_tote  k* M. `1 J  L$ [8 B5 c
        if A_tote="tote 1" then set A_induct to 1
1 E4 v: g+ x* t8 V- R3 z( B        else if A_tote="tote 2" then set A_induct to 2
7 @& j/ Z# [  i' e: L/ t9 ]            else set A_induct to 3    - y8 V2 E/ ^: l: v. f4 E' G; K
        set A_i to 0' T* ^, f1 M  z: i) m1 w) f+ y
        clone 1 load to P_induction3 }) d9 p/ v: K1 s! b# g$ m4 C
        wait for A_time sec7 ~3 T1 i5 v' G7 F
    end% }  i, B& j( V) [- w8 }
end" {3 L' G3 n$ c" d& u

& G9 i0 S2 W+ bbegin P_induction arriving
& ~# `! s( d. ]% D5 s    if A_induct=1 then clone 1 load to P_pick1+ D" S( ~1 K8 g5 [
    else if A_induct=2 then clone 1 load to P_pick2; [! O! o! C3 {' u, @; N
        else clone 1 load to P_pick3
6 }: W' s/ {) t  O( t+ vend; [4 K( T0 R& S
9 \# I5 z. O' B9 H
begin P_pick1 arriving
  c3 A  E( ]2 C: B    set A_i to 1
  l! h7 v' e$ ?# A1 z1 P% `( L    move into Q_induct1
+ V- h2 |5 \& t    move into pickaisle.induct14 D3 w( y* U1 l
    while A_i<=30 do begin: a8 R: |7 H2 X
        travel to pickaisle.con(A_i)
1 E4 q* Y( [/ i7 v- C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 T+ U) {1 w: a
        else wait for 10 sec
- }: y6 A  G/ v4 M3 J        if A_i=A_leave then send to die5 X4 Y0 O+ ]# a) P
        else inc A_i by 1
  r* \% ~% o& \1 M1 o    end
) K/ }$ F& `' {1 \4 _, Gend
; O8 D4 r/ l' O5 _8 ]: T: ^$ f# I) }/ k: P) G! R& ~* `( L0 \
begin P_pick2 arriving
; Z1 ^# G8 ^/ [! F, ?    set A_i to 11* F5 F, T- u& s
    move into Q_induct26 M+ y7 B4 z. M. E
    move into pickaisle.induct2' j4 B7 P& e$ N. f  P4 Q
    while A_i<=30 do begin2 S, K5 Q, ~4 D, \8 G
        travel to pickaisle.con(A_i)6 }4 v: [% g# [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: ?1 H8 X& |! G6 p        else wait for 10 sec" I# T* H" \# o
        if A_i=A_leave then send to die
/ u( ~+ J) X0 Q" B        else inc A_i by 18 g% x) X2 {+ q
    end8 w/ F9 p$ G$ R& y6 n
end+ ?) C! K6 j; [

2 q$ }" ?. i1 p) ~: lbegin P_pick3 arriving
8 {) F& B" h/ k' |6 k$ I0 x    set A_i to 21- l8 v4 c  p- x# A2 @3 W
    move into Q_induct3
0 X/ b6 A- L0 ^    move into pickaisle.induct3# x0 l; ~  U1 b: w5 w
    while A_i<=30 do begin# w1 b) W, g. {% A
        travel to pickaisle.con(A_i)
$ p, O9 x& \$ b9 Q+ \# Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- J6 Y2 o! g& m! C( u; |        else wait for 10 sec0 x: o! I! I! p& i
        if A_i=A_leave then send to die
9 p# P( C0 n% F  V; e        else inc A_i by 14 f5 m, W/ k3 Q, m" S( J! L  ]3 E- X
    end
3 [& f; Z5 H" Z: A) ]( C/ L, @3 Qend

最佳答案

查看完整内容

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是个什么东东?
/ R4 }6 k: U$ }2 x& ^3 m5 n6 U; smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& N4 A9 j+ S0 ?+ G0 c& O6 E1 p. E
. H4 O0 q8 @$ h0 h3 n8 S2 A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 Q& Y! @: B' d  F2 y

( S1 Y2 \) Y5 P1 O% G2 O) A) v另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
/ j' s% z, t9 h" `3 t' h8 C: V1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;) r) b4 ~, i3 K! H* a
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& n  I% @; l8 L3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# i9 H& }/ Y, e6 M3 O, T! b* o; Fbegin P_induction arriving
8 S- E& x9 x2 Z' k" j( G    clone 1 load to P_pick(A_induct)+ `: z: f1 g( m& l: J2 f- Z! c
end最大的系
8 v: o) ?! z: T/ ^8 A6 C) R0 w0 X5 i7 u' W  L  X) b% {  n3 X
begin P_pick arriving
! y, U: i8 Q  D    set A_i to procindex * 10 + 1% I5 @" N3 [9 v& V5 a1 A
    move into Q_induct(procindex)! H9 W! G& G# r1 G
    move into pickaisle.induct(procindex)3 d5 l5 o3 N# R, `; k# V
    /*check the type of pickaisle.induct(i), for your last problem.*/  I# [0 N* A1 k3 H- j: u# b7 r& O9 a

& r  Q  v- j0 a" T6 o( O    while A_i<=30 do begin8 ?0 f1 n- u) b( [3 z! F
        travel to pickaisle.con(A_i)
# h: ?/ c" Y+ P$ q3 {5 J) K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  T. t4 a  t: |* m9 m1 N5 {# q, _        else wait for 10 sec% c2 O; G6 \% h
        if A_i=A_leave then send to die: n% X$ z- C- i7 H, x" h
        else inc A_i by 11 D$ C' H. t. |9 Z2 X9 g/ u
    end1 J% t' a+ G! ^7 ~
end
9 M  U5 |& @9 j  W* _
+ I# ?" j* |) p4 ], Z  T6 m4 j其中的procindex为整形,代表当前process的序号。
! s4 p* r- z1 [+ _8 D0 ustation和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, 2025-9-4 13:13 , Processed in 0.020455 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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