设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9787|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢  N+ Y" o# ], n7 z4 e2 b

  S" J4 R' x- T( v: o我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ p, d/ l1 e# b
3 o1 ?# i) ~, ]3 ?# m) k
begin P_read arriving" R7 }4 P+ y- Y0 k/ F/ G$ l
    while 1=1 do begin; t' E/ {9 F) H( u& E2 U: e6 d
        read A_tote from "data.txt" with delimiter "\n"
0 G; c' m% t' c0 N$ s        read A_time from "data.txt" with delimiter "\n"
4 ~# a- Z. H) M        read A_leave from "data.txt" with delimiter "\n"# ~7 g4 ?) p% R/ b* U, I# @. D
        read A_picks from "data.txt" with delimiter "\n"
7 O7 F  t6 }2 g+ F        set load type to A_tote
+ X) s. \! i! G/ l5 S: v        if A_tote="tote 1" then set A_induct to 1
6 }  L9 X3 O2 k3 B        else if A_tote="tote 2" then set A_induct to 2* f1 e  _  C" z, ^
            else set A_induct to 3   
* F: t* B8 w( p7 n+ g) g        set A_i to 01 T' H: x$ j( [9 k8 ?- ~
        clone 1 load to P_induction: D& m' c0 y2 A: A
        wait for A_time sec9 ]7 }; f* x. s, V
    end
& g4 W$ x, u4 h3 ^# L; N, iend1 G0 Y5 [- f7 J* V3 X
. ]4 ^3 X/ M5 i! r$ W! D$ C  e
begin P_induction arriving
9 k+ _$ u! p! j5 _4 m+ V+ g7 _$ U8 w    if A_induct=1 then clone 1 load to P_pick1
8 a) l$ s0 `& @0 q    else if A_induct=2 then clone 1 load to P_pick25 J$ F* {& Z! U  H
        else clone 1 load to P_pick3' Z+ x2 G& w1 h" Y" x5 l
end
* c4 ]7 G' n" }4 ]7 F% K4 h* `4 t
  Z, p2 l3 \" mbegin P_pick1 arriving, A0 v5 [0 b2 c5 |, k4 c
    set A_i to 1
% I, Q( Z, _' e) {; W) a1 E) ^    move into Q_induct1
2 \# F2 u; T& Q* G7 U    move into pickaisle.induct1; T: |( |, u( x; Q* W2 c
    while A_i<=30 do begin! {$ N% |: H1 W' Z) r( K
        travel to pickaisle.con(A_i)
, g- P5 C6 C7 Y7 \7 w! O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% t+ s6 d: x" c$ X) i
        else wait for 10 sec& L$ y  r: o" ]! D
        if A_i=A_leave then send to die
1 P5 A0 M4 `# ?( V1 ?        else inc A_i by 1
6 ^" O+ V1 I, ?4 y    end
+ a7 l5 z/ \: L* z: j5 F$ jend
+ u7 Z, W8 l! t4 O/ L$ T6 [
* k2 u+ w4 ^8 j5 j+ k( u# Y0 {begin P_pick2 arriving
3 Z$ }# A: H! V2 u) M    set A_i to 110 Y* A4 `, t  N0 m4 }
    move into Q_induct2- D2 V0 d8 g* ~7 T0 Z3 w* G) n" c
    move into pickaisle.induct2
6 Y4 t) Y* s. @7 Y    while A_i<=30 do begin
7 O$ U3 _8 Y+ p( q* u& s3 @        travel to pickaisle.con(A_i)
: Z2 F: d1 k/ d9 Z* n5 `* V1 E; Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( ~; C- V( f& H% [8 t        else wait for 10 sec% F% G  b! g3 [% L5 J8 I+ P
        if A_i=A_leave then send to die
4 l4 V  n0 h* N! M9 u* i5 A# I" T3 G        else inc A_i by 1
% [3 k) W3 g, C6 c; t* b, k3 s- ~    end& O% D% I4 _8 E. Y
end
$ @. ?) B0 h( }; t" g
) i: J0 M0 `2 Kbegin P_pick3 arriving  g9 X2 F1 b+ b
    set A_i to 21& r$ @. y2 z) f' F& h$ u
    move into Q_induct3
( t, Z; ^  i2 d2 U) ~1 _& L8 ]6 N    move into pickaisle.induct3
9 ?% Z' h( P' f3 I    while A_i<=30 do begin4 l4 w) ~7 T+ |0 e
        travel to pickaisle.con(A_i)! l  @; t+ Q- y. j* g& k; O& c: ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 q6 Q9 ~. w- n4 D/ h
        else wait for 10 sec" I; L8 n! k- X3 t: L
        if A_i=A_leave then send to die* Q& z7 }/ J# e+ ]
        else inc A_i by 1
* ~; _, C* o- O1 _! c    end3 N* X! u) Z6 y" X
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是个什么东东?- B) z! m9 [% D  ^( j
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  c& w1 S1 {0 D
: C% S0 X) |" d& w5 U( M8 }+ UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 O" l0 M  j# a9 X7 k- Z% I
- k/ p, U- L4 M! c  K) G
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 N( h2 a7 v; N4 A. o% ~( h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ {  z8 `( O' c7 B" m9 X1 [
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& M  M2 o/ e4 V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; S: ]7 Z+ ^( y- v5 `0 c5 e
begin P_induction arriving
6 G( s. U( R- Z* f4 K3 A: B- q9 |    clone 1 load to P_pick(A_induct)2 g# v% h) b6 @$ ]$ \+ O. R+ P
end最大的系
) d, @( p  o' u# r/ C- f, N. K0 Y2 u' U5 B0 Q9 Z
begin P_pick arriving
, y4 w* W9 }3 w, U    set A_i to procindex * 10 + 1* i: ], E. b4 F: U
    move into Q_induct(procindex)
. k! X' i& F) [: Z- D    move into pickaisle.induct(procindex)1 I2 U8 Y1 M& \! x5 ?' k
    /*check the type of pickaisle.induct(i), for your last problem.*/
$ j; Q* S+ ^9 {2 b
5 l# f$ a' D( j4 `    while A_i<=30 do begin4 N( J1 M- `' Q. `$ k) q" k
        travel to pickaisle.con(A_i)
$ J; }9 t( q. t& v5 V$ w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; X2 y+ k5 V6 G% W  c  y( F, a        else wait for 10 sec
) {2 [) S* L' N$ G3 y        if A_i=A_leave then send to die
7 f+ Q3 [1 b& \# f9 F& Q- E        else inc A_i by 1# A$ c  n2 c$ c( Q" I
    end* l* Z+ T; u. w2 l4 J% `/ Z
end5 `! p; ]' `% m3 N
+ g7 ?- C9 \% Y& g, P
其中的procindex为整形,代表当前process的序号。% J3 a/ {( g" C( f
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, 2025-7-5 00:33 , Processed in 0.014088 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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