设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12148|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: _0 ?8 O3 G0 ~$ h! k3 n8 f
2 H* S1 F& K" x- O5 j/ X1 K( K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。, a% `1 }; [, T" ]4 M; s" f% x
/ {5 y/ \; V( \
begin P_read arriving% B+ L) z. D$ k9 L9 Y- A
    while 1=1 do begin
8 Y/ V( c+ E2 K2 W4 {* j: a2 E        read A_tote from "data.txt" with delimiter "\n"& q9 @$ I# d( H
        read A_time from "data.txt" with delimiter "\n"
$ n' W: Y- D; G  E- ^" \! k% k        read A_leave from "data.txt" with delimiter "\n"
4 [" U" a9 x" e+ X        read A_picks from "data.txt" with delimiter "\n"
- Z! R6 I* a& U2 \        set load type to A_tote: H1 H1 m* x$ C8 t/ x8 L
        if A_tote="tote 1" then set A_induct to 1. h* g) p( ]- O. i' s
        else if A_tote="tote 2" then set A_induct to 2, P+ k! Z- T: D
            else set A_induct to 3    , p* c4 s# b% r
        set A_i to 0
) k+ a( _- I: j: l        clone 1 load to P_induction  J5 @9 e0 L7 q
        wait for A_time sec
8 f% ^* o5 B9 B6 W9 w" y' d' Q    end
/ V- j. ^7 Q: U2 yend
' W+ o  T' h- I& A2 {, r: l+ u4 j3 y1 ^  O& G5 ^6 \9 m. ]& e
begin P_induction arriving+ ~) D! y& Q' T
    if A_induct=1 then clone 1 load to P_pick1
* G1 P. z# S& J/ o- K; n    else if A_induct=2 then clone 1 load to P_pick2
& E4 e  T2 I( V& b        else clone 1 load to P_pick3. c- ^# p/ l3 v- m
end7 i) V5 z( ?3 q1 G

# Y) ?7 w$ L! }begin P_pick1 arriving
& s* k3 n5 P  P# H    set A_i to 1
* i7 j5 g/ T% _# J' p1 w0 D    move into Q_induct1
& |/ @+ r. j; P: O3 e& j4 ]5 W    move into pickaisle.induct1
, `0 m7 v- `  h    while A_i<=30 do begin
5 b% F* a2 k8 g( x- O- J        travel to pickaisle.con(A_i)& g% J* c8 A( C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ U* T7 w- P0 Y9 Q# u) y6 O+ m% Z* `4 J
        else wait for 10 sec% ?) l9 @* a$ m9 {
        if A_i=A_leave then send to die
3 S* r8 s" g; H1 X% q( A        else inc A_i by 17 p; \6 q& L$ z4 K
    end8 U4 Q  Y1 X" F. {- r
end
1 _  P' d3 V% x) l1 {7 G
& L$ s& o$ w: _& V4 d8 y# ~- \6 vbegin P_pick2 arriving* u% C( e4 ~+ [" j! U, G+ L
    set A_i to 11
- ?  x$ G2 A4 {) G    move into Q_induct2
# l6 n+ Q+ r7 X8 V) z& ]    move into pickaisle.induct2
" g6 s+ Y/ t+ l    while A_i<=30 do begin
! [6 ]+ e8 C: j% v0 t! s/ N        travel to pickaisle.con(A_i)% U' L4 u9 Z4 W5 s' T$ @( z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& X$ n' R. X# J, Q
        else wait for 10 sec
& F6 s& f- @! i4 e        if A_i=A_leave then send to die! J8 i/ ^1 A7 K2 s
        else inc A_i by 1. N2 C/ @6 I8 O  @
    end% {  t5 w- t( m$ v: R0 {* I
end
4 N: q4 p3 F" V3 T" [
6 }3 ~3 E" w* V& y; o* y1 q! Vbegin P_pick3 arriving: g" c/ N+ P- n4 {( u
    set A_i to 21
9 j- j2 g! I- i3 e7 p3 U, {! U    move into Q_induct3; [! l& w! Q! Z3 Y# i
    move into pickaisle.induct3
: k; y' f9 p6 o0 |    while A_i<=30 do begin) S4 J) F" a% a4 \: _7 L! b- S; f
        travel to pickaisle.con(A_i); @4 o+ `6 Y4 J9 n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 U6 p1 }$ S6 |3 h" _6 a
        else wait for 10 sec
2 _: [( |$ e- `1 y4 z        if A_i=A_leave then send to die
1 G: l4 O' O# v6 i6 u0 J0 A2 b% E( G        else inc A_i by 1/ [: a4 v6 u! ?, D
    end! _/ s# v" W1 e' B, J
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 V9 o, Z5 h+ h. D- Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, S: c9 e% ]6 r# Z2 i

  A& R) I4 K# [  g$ H# P7 MAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) e* S" x5 z/ b. Y4 w/ B
) |. }! t. i, f* o" L; \
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: P# l3 H( q9 U0 q* T+ v' w
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ w) F( l! M2 R6 s+ W
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) p. L0 L& V- ?2 w8 ^' M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( l9 j7 Y# g& t3 H7 V: t
begin P_induction arriving
" l) g7 V% E2 \. D8 n9 H7 k/ ?    clone 1 load to P_pick(A_induct)8 X; y: f- F+ a' I" f# L
end最大的系
  N6 E; |  T2 U4 u
1 L. v5 \; v& O$ c6 d& Jbegin P_pick arriving! E7 g- ^) H, S
    set A_i to procindex * 10 + 1
& G# P8 K! Z8 z- a' A1 n1 @    move into Q_induct(procindex)' T$ t( j; j4 t7 F5 ^& B
    move into pickaisle.induct(procindex)+ w) u. h' H* T" @" G
    /*check the type of pickaisle.induct(i), for your last problem.*/
. r0 H5 E- H- y$ K8 y7 j2 D  e
; W( G% |4 k; x6 s% v    while A_i<=30 do begin
) o& }6 o3 G9 s; ?$ R- [        travel to pickaisle.con(A_i)
6 F6 n7 x( w* a- d$ M( B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ D% N% Y; A; f8 u# N! C, ~7 e: G* B
        else wait for 10 sec
( R6 H9 G6 k% Y3 X' {3 s        if A_i=A_leave then send to die6 X! q" J3 ^. ]/ y2 v* m! }& B% T/ M1 m
        else inc A_i by 1
7 |; {( {* s; v; E9 N    end& B6 [/ h" e; b0 x$ O
end$ I  }' t$ @! V+ J2 @4 I

. @; C& r( a4 |其中的procindex为整形,代表当前process的序号。
+ ~: W4 w9 e# ^6 M5 @; }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-12-31 10:33 , Processed in 0.019060 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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