设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14208|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, R5 T9 l8 c( R( t- t. ?' N
6 X. O/ R2 ~% w$ 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中的数值,不知道会不会有什么不妥。& R5 h5 @6 ^* X7 k/ o$ A- m/ R! R0 Y

. @" Y# E. h! V0 r+ Nbegin P_read arriving3 a* ?# L/ Y, R2 \4 K& ]6 G4 I5 H# [- A
    while 1=1 do begin
) v. b! a& E& u  {! _. T8 x        read A_tote from "data.txt" with delimiter "\n"
2 c0 N2 }7 `7 N4 f) o5 A        read A_time from "data.txt" with delimiter "\n"$ X3 @! w3 m0 e' |
        read A_leave from "data.txt" with delimiter "\n") J6 X2 q, \+ }$ ^4 H& i4 s
        read A_picks from "data.txt" with delimiter "\n"
, R. E' `. c) P& t5 z/ y# [        set load type to A_tote( v9 d, i" p/ }- c' y
        if A_tote="tote 1" then set A_induct to 1
$ x9 P/ s9 N1 s# {        else if A_tote="tote 2" then set A_induct to 2
' p8 `' _$ t5 B2 H) f. D& i            else set A_induct to 3   
  Y6 Y# I: U2 {" @* A; y4 Y        set A_i to 0
/ k* o: D; ?" P* s' k! Y0 z        clone 1 load to P_induction( d$ w4 q3 |- [9 X6 w' _/ e' p
        wait for A_time sec
7 b, V7 k7 f8 a: H5 I    end* f% M" Y8 q' M7 F, B  p* k3 E2 U
end
% B+ w% V* {" g3 C0 B* {5 E! _- p' @
begin P_induction arriving
* N; ?+ a+ U0 x5 N2 U2 v2 N    if A_induct=1 then clone 1 load to P_pick1
* _! o9 T) h  Y9 [: `, [    else if A_induct=2 then clone 1 load to P_pick2
3 s  B3 ^' j0 J( y+ G7 |        else clone 1 load to P_pick3
5 s1 [7 z' P+ nend# M; F1 h: c: l. y8 ?& E
" c8 t; }; R9 O
begin P_pick1 arriving( c& t+ A6 G) g: ~$ Y7 Z% X
    set A_i to 1
! B8 X1 {& u6 z, h9 _" b    move into Q_induct1
2 \% u% Z( u3 I9 g1 {) ^' c8 P" h( {/ N    move into pickaisle.induct1: O! ~7 W0 b) Q$ k& u+ M
    while A_i<=30 do begin- G  o& v6 Q3 Q9 i, i% p/ z1 @
        travel to pickaisle.con(A_i)- ~# X. ~. i( ]* _8 `4 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) l$ O/ S/ U0 e" R        else wait for 10 sec
/ u. B* _8 L4 K- U3 S% \        if A_i=A_leave then send to die
% k# \, Y1 s8 }( p- |        else inc A_i by 1
, g3 x! i9 b3 |6 i7 e) @% j1 [    end
3 m( U3 t  P' P# o2 H1 \end* c6 ]8 X$ a2 X$ V
# `  \6 @  k! i$ i1 O) d7 d& e2 `
begin P_pick2 arriving- B4 V; {- m: p& m; v  t
    set A_i to 11+ ]& h1 M2 h7 E# u- M
    move into Q_induct2! q: A+ y" P' X+ h
    move into pickaisle.induct2
% v5 }8 |9 z8 a; W0 p8 e    while A_i<=30 do begin
2 s6 M- _* o% T2 B: E- Q        travel to pickaisle.con(A_i)! \# {- Y% r' }) P* P8 D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 P! r7 F4 Q  n. R' ~( n
        else wait for 10 sec
/ E, A1 |7 h( \( C* k0 B        if A_i=A_leave then send to die
$ o* M9 W' a  w- N- c        else inc A_i by 1
9 ]2 V+ n; l2 e: S) @1 K! R- _+ s    end( M! N0 E! u2 o7 p! j+ u/ E
end
/ K& w+ V3 I! c' S
+ C. H9 y# f: Q+ S9 vbegin P_pick3 arriving
" c- a+ s* ]4 T* Y" v$ p    set A_i to 211 h$ v. h  J: W/ P1 g, \7 J! ^; y
    move into Q_induct3; N7 [4 \% \2 [4 R$ G
    move into pickaisle.induct3' Z2 a: Q  y: s8 M# D
    while A_i<=30 do begin
& F( L& ~3 w9 Z- w% I. y% g        travel to pickaisle.con(A_i)" h. O4 ?, C8 r1 ^7 b# k% ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ?/ `- ~- f1 x+ g7 X( w, Z: G
        else wait for 10 sec
& T5 V2 w7 n# J- K        if A_i=A_leave then send to die- f5 \/ f' ]7 f
        else inc A_i by 1, ?3 N; \0 D' Y: \" y$ ]/ `7 t
    end
* c' ?' A$ G5 send

最佳答案

查看完整内容

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是个什么东东?2 J( V# x0 ^3 o! j/ R
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- x6 C6 l1 Z' S4 O. `5 e& q; {, g

+ h$ B9 \$ K+ P( i, oAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 u* ~6 s( ?0 k( g  K+ ~
- W) y$ m- W0 s) P4 j2 H% O另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 [- I- }; H5 n- q' r0 M! Y4 T1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 R" l+ l# Y5 p; T5 g2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 v. m% W! ~2 W5 T# N% T3 H+ l4 X- ?
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ D6 V8 {( R) X3 ]9 n1 n+ X) Tbegin P_induction arriving
, q, B& @- R  r% s+ A2 k    clone 1 load to P_pick(A_induct). D5 J4 ], I$ @8 U2 O) c0 k5 n1 j7 U
end最大的系+ f6 u! z5 ]  I) b/ Q
* ~3 M$ ]  C& M! s* ~/ q
begin P_pick arriving
) Q" U4 C  T2 S0 p3 e# |  r- |( c    set A_i to procindex * 10 + 1& G$ {- l7 N. D2 c! R4 X0 k( H: w
    move into Q_induct(procindex)+ Z/ K6 v3 s% f, Y; E5 q4 y1 J
    move into pickaisle.induct(procindex). l! J7 o4 M" B' d, \; G5 j
    /*check the type of pickaisle.induct(i), for your last problem.*/+ l/ p0 v: _  S' A3 |, |% t5 w
* r- c$ R* v# s8 l
    while A_i<=30 do begin
/ A9 `4 y/ }8 w% L  t, I        travel to pickaisle.con(A_i)0 }. A6 c! U5 ~* B) i  f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 E% c: t3 J4 V        else wait for 10 sec, z9 W0 r5 ^, m2 p
        if A_i=A_leave then send to die
# h7 p/ U2 F/ ^  N        else inc A_i by 12 e8 e* A% d0 y& ^# |& W
    end/ |2 c5 g' m# n: P% D% V3 m
end7 t% z1 W, y; `6 l1 o) s

0 z- n5 N. t3 p( Q7 W其中的procindex为整形,代表当前process的序号。
1 }5 x% t1 |8 Q6 h- Gstation和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-6-20 14:53 , Processed in 0.017816 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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