设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12307|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 t3 j' q: r  M5 a
# g6 h1 T5 y- a7 P: Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 z: C: I9 [. f9 v, R! D

3 i) Q$ R/ q5 nbegin P_read arriving
( `/ d1 B/ U3 q; k  _1 J' {& l    while 1=1 do begin/ |2 S2 N% |, F) v* I, Z
        read A_tote from "data.txt" with delimiter "\n"
0 [% v; |: N; Y1 d8 M5 P, P+ y6 e        read A_time from "data.txt" with delimiter "\n"
% ~# |* e, o3 a+ ]1 z        read A_leave from "data.txt" with delimiter "\n") a8 ?7 E4 ]8 b3 @% d" D! a
        read A_picks from "data.txt" with delimiter "\n"
! r$ t/ l* O' e: E+ {        set load type to A_tote
5 g6 g0 i1 J- e        if A_tote="tote 1" then set A_induct to 1
  b; K: e/ ?7 x        else if A_tote="tote 2" then set A_induct to 2
/ |# [* A% }' {% D0 g# h: O            else set A_induct to 3   
! c) R' j7 q2 i% F: ^; ~        set A_i to 0
; Z, A  ^" L0 c/ j% f2 F  a        clone 1 load to P_induction
. Y: z3 w# M% ~0 \        wait for A_time sec
' `, h- d* P1 h' o. d# U" K3 V    end
0 m- K* o8 d- b6 [. q3 ]end0 l8 C$ |. o9 T0 v5 o1 A

5 c4 u! W: p% l: A! O) Lbegin P_induction arriving
1 G# N0 {' E" t" u$ P( P    if A_induct=1 then clone 1 load to P_pick1
8 A6 l: i; ]: B+ `" g    else if A_induct=2 then clone 1 load to P_pick2
# ~- r9 v7 O6 ?0 h# F, d& e  i        else clone 1 load to P_pick3
5 N4 q& [" \3 _+ G' U+ S+ l3 fend7 o8 D6 b# q9 p2 b! {" y& p4 g
& G7 U' P! S5 v9 C' M9 q8 h
begin P_pick1 arriving
" g! a- u" t2 v6 J3 k- k; z    set A_i to 1
) Y  I% Q7 g5 U) K( \5 J3 d+ o    move into Q_induct1
) D8 E7 ^. P2 I0 ~' H) O3 a: h' q    move into pickaisle.induct1
& R6 K5 q5 p0 p* `5 b    while A_i<=30 do begin
! C6 p& d6 B0 P+ Q6 L6 K1 e& B        travel to pickaisle.con(A_i)
/ I, b" Y# L1 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( C$ @) I: o: [7 y. R8 y        else wait for 10 sec
: H% ?. C8 o7 {) C) v        if A_i=A_leave then send to die
# _9 e- O! I  @) ?5 E, q; d  Q        else inc A_i by 1, ~% w6 Z+ b' w
    end/ A3 l, {# Y" z2 E
end
  J6 Y2 }2 q1 E6 z& u! E: O4 j& v" W6 @0 h! d* y2 s* @
begin P_pick2 arriving1 r& |  W% P0 \
    set A_i to 11* ^, \3 E) E" R% G1 m
    move into Q_induct2
/ e7 w# h' y  }7 t. x+ Z' _3 a% V    move into pickaisle.induct2
. r# t( S7 o! O& W& u( s6 l    while A_i<=30 do begin
5 q* c, {5 W* Z6 }4 I: y        travel to pickaisle.con(A_i)8 s0 O; h. s! M1 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( Z4 W+ Z0 S3 C( t- j+ C0 O
        else wait for 10 sec9 A6 O2 c# r3 D1 x3 q
        if A_i=A_leave then send to die& l- g  |7 b) b5 h6 E6 W
        else inc A_i by 1
* Q- d1 E' @  i# j" Q    end
" m# y. [2 `- Pend. l& u% }) u. s7 `: c

* F( X5 D4 T, p5 F) q) F" ~begin P_pick3 arriving
* W+ S2 M, H5 D- r, M( g    set A_i to 210 b% m& J% d. @' W+ h: }
    move into Q_induct3
! ~. h  j. u$ S. |% ^    move into pickaisle.induct30 w  ^7 a8 k6 w& Z9 I
    while A_i<=30 do begin* a% \8 I8 m+ w) `& e% T
        travel to pickaisle.con(A_i)# Z# Z- f, Z6 c- |9 y9 w6 I# r* G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 ]8 y4 F' X7 o; I; x$ s        else wait for 10 sec- I6 @2 z% Z9 i6 A: {* l
        if A_i=A_leave then send to die) l0 T( y( ]' \0 g2 |, f" w
        else inc A_i by 11 ^5 L8 K" [. }! i, m5 ~
    end
3 q- z6 I7 D9 fend

最佳答案

查看完整内容

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是个什么东东?
7 a6 `8 j' A) d/ jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( b- E8 Y" {: ?# o2 P; g
3 D% e. |7 x6 v, A1 M3 QAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& T9 ^* e' z& l+ c- L" B% h% Z7 z

. S+ F6 z) U6 f4 S  z6 f0 q) t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 \" N8 K; P3 k, x) b4 A1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ |% p9 K* o/ |2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ d, b' l+ Y4 g1 [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 W5 ?+ o3 x+ G  `
begin P_induction arriving! P# R: E3 g9 K/ N
    clone 1 load to P_pick(A_induct)
0 u+ r  Y/ e. u8 A$ O9 E7 D/ {end最大的系0 ?0 N/ \5 j2 {8 ~% y# i6 C) g1 o
2 \$ A/ B" q' ]* A0 [
begin P_pick arriving
* y  }6 ]2 V! }2 ~1 R: v    set A_i to procindex * 10 + 1
! B, [& x/ ?& _    move into Q_induct(procindex)% f6 B- a# J# u: p5 ~
    move into pickaisle.induct(procindex)
$ U! r0 b! X6 C# U# p4 U    /*check the type of pickaisle.induct(i), for your last problem.*/5 s/ q! i* D; s9 b! h0 R

9 o! B, r- H- N5 v6 c    while A_i<=30 do begin1 _) {( {9 `7 w
        travel to pickaisle.con(A_i)6 V2 G6 i5 N; I) B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ _% N8 h. Z1 |' M' R        else wait for 10 sec
: G3 I3 x: Y3 q2 A3 }) t        if A_i=A_leave then send to die
3 r  O9 [/ c% u( \# g, ~8 x        else inc A_i by 1
) r1 Q# e' Q% A! O    end
% ?+ O7 C& }2 a. H9 e# Nend/ r4 h" }5 q( e

$ T8 Q+ T; H( h7 l: ~' x5 ^其中的procindex为整形,代表当前process的序号。- l# ^, |3 U" ?6 x
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, 2026-1-12 14:54 , Processed in 0.021661 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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