设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13157|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* ^+ O$ J; _( U( ^6 j/ E$ N1 l& Y6 {; g8 K5 t4 z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 X* G1 P/ d% x# E0 g2 y
5 r( G7 k! z( m! F
begin P_read arriving
4 C- G: j' C% H    while 1=1 do begin6 \% b" A% ]; Y$ [
        read A_tote from "data.txt" with delimiter "\n": Y8 i' U' F( u) P8 S; b, x( W' [9 s( H
        read A_time from "data.txt" with delimiter "\n"
: R# |( v: P$ V3 t# I/ ^        read A_leave from "data.txt" with delimiter "\n"( I1 Z2 M8 ]7 G- E
        read A_picks from "data.txt" with delimiter "\n"1 ~! W7 r% M3 f$ m5 t+ s) B
        set load type to A_tote
: Y/ |2 M& K( B) ~) F        if A_tote="tote 1" then set A_induct to 1% h' {& X) {) w7 I) i
        else if A_tote="tote 2" then set A_induct to 2
  o- u! B6 ?8 W# ~            else set A_induct to 3    9 n* y! q; I9 ?1 I
        set A_i to 0: q4 O! v; l  V5 O: |/ n
        clone 1 load to P_induction6 c8 j4 q! m* m
        wait for A_time sec
  O$ v1 g1 x7 n' ~    end7 K1 ?6 }. e8 p3 w
end  N2 Q$ f* w* p' X* Q9 Y
& }) R7 i; k  K0 B
begin P_induction arriving' Y2 n: ]5 t! Z( X9 ~" v
    if A_induct=1 then clone 1 load to P_pick1
& s4 F* l8 g; F3 S% x    else if A_induct=2 then clone 1 load to P_pick2
3 `7 O$ W5 i- j2 X0 r3 w  p3 m        else clone 1 load to P_pick3+ V7 {5 Q' r  M$ F2 g9 x5 j
end  B- R5 g# j* K$ W
8 D% G3 v# Z5 I  Y4 R5 k; f
begin P_pick1 arriving- R5 O2 W! @& S
    set A_i to 1$ v2 G5 Y# x/ D& k
    move into Q_induct1
3 L1 b6 g2 O2 X( X* [    move into pickaisle.induct1' x- Y* R' Q0 _. H) N2 X
    while A_i<=30 do begin
6 _: g2 X: L; z" `        travel to pickaisle.con(A_i)) h$ B2 Q6 O7 j1 r& k$ E( z  O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 A9 \, r! P: P& r+ E        else wait for 10 sec
+ M( X, Z- d& J- X        if A_i=A_leave then send to die" Q2 @6 g4 _  X2 J. @; D
        else inc A_i by 1
  k3 u) Q8 r0 s; n$ H) `3 |    end
& b/ \. Y$ h( W# i# uend
2 u6 M' C& o6 Y( D3 w( l2 ^5 O: H( d3 q" T
begin P_pick2 arriving- q; q% Q& q! ^. B
    set A_i to 11; i) t1 a! t- D% ?' K+ L- [
    move into Q_induct2
% O+ @5 |! B7 G; X+ C0 d) K' B    move into pickaisle.induct2
0 a/ i+ L; G; G2 ?    while A_i<=30 do begin( V6 E- m; q8 q/ Y: w' u( q+ v
        travel to pickaisle.con(A_i)
# a$ Z6 s' ^. Y( ^9 {& y3 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 X0 k4 G! G4 J8 T/ m. q, ~        else wait for 10 sec# R2 ?4 c$ U$ E, \- V. I- T# C
        if A_i=A_leave then send to die# p( A; S, p/ R6 a- D
        else inc A_i by 1. |  N! {. _/ e1 h
    end
8 z! `, B5 N! h5 e7 y# g* Dend5 J) H2 d* I  w

4 R) P/ V& \0 K/ F2 ^# Kbegin P_pick3 arriving7 P% i8 X, x6 m& G" a
    set A_i to 21
. B5 t! m* F/ @7 K    move into Q_induct3+ I- [( x1 l2 J4 @3 F
    move into pickaisle.induct36 r8 m! @( w0 r, s8 O
    while A_i<=30 do begin4 v2 ]" g; a: E- h, _1 R$ a' {5 ]2 k
        travel to pickaisle.con(A_i)* @$ c$ F0 M8 j; M) Z4 D" T6 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% }5 f1 ~+ m1 _        else wait for 10 sec# ^! t; W8 E) @/ p6 J
        if A_i=A_leave then send to die
" R3 J& j" c7 u' o0 h        else inc A_i by 1" V2 K# P! s, W9 Q- r( `3 V$ ]
    end4 D4 V' u( e1 p8 \1 L
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是个什么东东?9 Z7 W& o/ Q3 h) J& c% Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 M2 K+ Q5 k- \* g% S+ h
6 G6 u7 W/ ?9 L( u% W; {$ h$ iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 N+ V6 P5 w4 h5 [
- z1 r1 x3 N, ^2 i+ z7 G. l) L& |
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:" g) x) V7 S* U. q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ V7 i( d, F3 Y: g2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 d% M3 Z% T/ _1 X; a3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ s, q, B) u/ i  ]begin P_induction arriving
( x* Y" E; H3 N' ]6 H4 A( r. {    clone 1 load to P_pick(A_induct)9 o, y( _. d9 k" W
end最大的系
5 `( R( e9 I% {" X! P$ j& t) W. N7 b  C2 \# A5 z
begin P_pick arriving
- C; x! R8 R$ W" t1 T    set A_i to procindex * 10 + 17 }5 n0 Y/ d" E& l
    move into Q_induct(procindex)9 z" F  e$ v! j& A4 U
    move into pickaisle.induct(procindex)
% c' |/ I; ?1 I8 r) w! a$ R% y8 A7 x    /*check the type of pickaisle.induct(i), for your last problem.*/
, `& L2 l0 x7 Z  y( ^" [; L; u) b: ~" O3 l
    while A_i<=30 do begin1 a5 ?# n, j" p! |
        travel to pickaisle.con(A_i)7 }" }6 [6 F- Y% n% b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- S6 h  U3 X. W" a3 t" U- ~
        else wait for 10 sec
6 W6 \3 ~3 |( u' ^) r: E# O+ \0 h        if A_i=A_leave then send to die
- \; t" i1 j9 D) ^! n        else inc A_i by 1) G* W% y6 d2 Y4 a" v$ H
    end1 Y3 F5 l8 T- B3 y/ p! S; f
end4 `+ f$ l% A1 A0 a3 o5 F- l
/ x0 W# _" j+ `6 O. ?! H+ p9 r
其中的procindex为整形,代表当前process的序号。
& C2 F" P6 f0 o+ Jstation和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-3-22 18:04 , Processed in 0.018212 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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