设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11634|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) v  o' F0 C$ o7 V* u1 S* d: f4 q/ d0 j+ J2 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中的数值,不知道会不会有什么不妥。7 N( _7 L6 c8 h

5 ?; W* r* k# Y1 w1 K4 B) `begin P_read arriving7 x2 K9 @7 D. \: F
    while 1=1 do begin6 L8 ~& J) Z9 @* j" l
        read A_tote from "data.txt" with delimiter "\n". b( i$ q3 i$ b/ @- K/ H; q. d
        read A_time from "data.txt" with delimiter "\n"
( y& @6 r: d  a) {1 d1 R: z+ @        read A_leave from "data.txt" with delimiter "\n"0 v1 S- B' [' [( s
        read A_picks from "data.txt" with delimiter "\n"
3 P5 s5 ]' Q0 J" B3 l+ `4 q        set load type to A_tote
! V/ N. A5 N5 ~: t        if A_tote="tote 1" then set A_induct to 11 _; W" Q( A1 o2 n
        else if A_tote="tote 2" then set A_induct to 29 i5 K. Z- L9 r+ v. l- o
            else set A_induct to 3    ! j* z" v( s/ V' u  P
        set A_i to 02 h4 ?3 m: V, c+ R( g8 M7 x1 q7 `
        clone 1 load to P_induction) v5 r8 F  {+ @6 @/ K9 j
        wait for A_time sec; m& u' ?7 r) j; y
    end0 a* j/ q) J0 E1 z! O8 ?2 W
end
# x! H7 _/ ?- y& I; W( p; `  {* c( K  I( q
begin P_induction arriving
$ H# w4 @: m8 o; e9 o    if A_induct=1 then clone 1 load to P_pick12 v  D; g8 Q5 l+ {
    else if A_induct=2 then clone 1 load to P_pick2" C! O2 {- @& T+ h; P
        else clone 1 load to P_pick3
- F+ x" n, t. ~+ V! [+ [; Lend7 N! S" H! ]% I3 X
5 }4 B) L* b. f) K
begin P_pick1 arriving  m- L1 K6 \( I
    set A_i to 1
! I# I9 l& o5 ?2 I- c+ a    move into Q_induct18 B1 R7 O- {: ?4 @& S
    move into pickaisle.induct1' ]! L# W6 V3 G
    while A_i<=30 do begin
3 x" k( [* u; T$ y9 d        travel to pickaisle.con(A_i)9 e0 `/ ?2 g* r$ @* d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 |9 h  t) p) c! R5 ^$ b: J0 U        else wait for 10 sec+ r) S  ?1 ?" l% r% y, G* D! E7 h
        if A_i=A_leave then send to die3 Q# [, T( z  }. d
        else inc A_i by 19 i5 _6 i; R) o% Y+ Y0 h2 N
    end7 M7 J) Y/ u& n, r& D: W; S
end4 F" D3 m3 h6 d0 P: ?2 s) H$ t

4 X1 U% q( u$ G1 l# Sbegin P_pick2 arriving
/ F: l0 b% G) \( y$ s3 t- z' ^    set A_i to 111 C( E8 z; J( U/ p2 ~- _; {
    move into Q_induct2+ o, t' v# D- `3 t: \! I
    move into pickaisle.induct2" C. O0 x# C$ ]8 b! X/ k/ Y
    while A_i<=30 do begin  L/ @' g2 D9 Y: x5 b
        travel to pickaisle.con(A_i)5 c6 Q  C3 y# a6 k" W# g0 Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! a( ~- k' T8 o
        else wait for 10 sec
' `6 |. g- X6 x7 e! T1 k1 E& x  y+ w        if A_i=A_leave then send to die
! [5 d  L5 p3 ~) R" ~        else inc A_i by 1
. ^. c9 m) Q7 K+ n0 |8 [7 ?3 w    end
7 W7 f2 {3 a& p1 T! fend! d; z( r9 I8 e. [% g
$ @6 j# p& c) Z5 Y  U
begin P_pick3 arriving7 e1 Y5 s; L6 \* O6 M
    set A_i to 21/ o, F/ _4 E7 \3 @8 @+ C6 X3 C
    move into Q_induct35 l) U& t! m' u  z4 H/ L, V; R: N0 A
    move into pickaisle.induct3
8 s$ v8 `$ @7 ]2 d" g) _7 c    while A_i<=30 do begin
: z4 `! t: m3 @. o& {' h% S+ k5 [        travel to pickaisle.con(A_i)' ?2 R1 f5 m" F8 X, H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _5 u( ?8 _* e  B
        else wait for 10 sec8 w  D- j" g3 m: @' ^
        if A_i=A_leave then send to die5 k; b2 \4 U4 V% t* T
        else inc A_i by 1
# f$ e- y# ^4 m! L9 }    end: Z/ T" h/ \! \% _: ^
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是个什么东东?1 w0 A" z; H/ X* R* t" c4 H. H
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' E6 C" v/ |" a& v
( X. X4 h: V# z8 lAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; i. H1 Y' ]% ?" k8 S  |
5 J) [6 T: X7 O5 {+ ~! y  D' B) N2 y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( V7 t* T( I1 J$ Z6 h& O1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ X. U4 N6 [' x! ]& q+ E2 d( H- Q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: v6 i1 z5 ~5 `8 ?3 D' R. _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- S: }# h7 ?/ _4 h0 P) z0 X" G
begin P_induction arriving
( N, t: A7 I! R+ T    clone 1 load to P_pick(A_induct)# }, M% y) [/ y( u6 g9 e2 ~- s
end最大的系' Y: X, T$ K! ]* B

/ i+ O7 P5 d/ K2 Obegin P_pick arriving
& Y4 ~* W7 R5 T6 }/ s- q0 Z    set A_i to procindex * 10 + 18 i2 n1 h& |2 A5 W. ~
    move into Q_induct(procindex)' H  Y: w" ~- d
    move into pickaisle.induct(procindex)
. E3 t( U# H# a/ o" G    /*check the type of pickaisle.induct(i), for your last problem.*/, X4 F% ?5 C! {) t+ P' e1 Z3 F) h
8 n" f! z1 G! f. U) b1 |4 F
    while A_i<=30 do begin
* ]% X# n, R) _( v) g& x- l% k% _        travel to pickaisle.con(A_i)& L$ n5 E' B7 ^" j) r0 n( B/ T5 R/ C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 s+ y. E3 m' \$ H. r        else wait for 10 sec
- A% P7 I/ r$ L3 v0 w        if A_i=A_leave then send to die
, s  d- L' w% p5 a        else inc A_i by 1/ e. m9 t- J: N; D$ A8 E! }
    end, l/ m8 ^0 C7 q7 z
end
+ q- j0 C$ X0 D  L0 R; t
- \+ D; G# \3 A7 O1 V4 a其中的procindex为整形,代表当前process的序号。
% P6 B' \. S6 B% q4 _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-11-25 02:48 , Processed in 0.014070 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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