设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15372|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 f8 j0 H# Y- {7 u4 {2 l
; j5 x; M! S: p- p( R+ w: c: {8 w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  {; g! A  I$ J1 `& n2 i8 i, Q4 Y( k
begin P_read arriving
) \5 s# p" Y1 s+ O8 e    while 1=1 do begin
$ D# {* M6 q5 l  k) h        read A_tote from "data.txt" with delimiter "\n"
+ H; v7 x9 O9 d: a1 I! P        read A_time from "data.txt" with delimiter "\n": l9 j  o3 L' E, X$ y- B4 S
        read A_leave from "data.txt" with delimiter "\n", @. Q  B/ W& f' F  ~4 z2 W4 a9 ]
        read A_picks from "data.txt" with delimiter "\n"7 p5 m% o0 H. s# Z8 B$ i8 H
        set load type to A_tote$ n/ W" ~9 u: v4 }6 p
        if A_tote="tote 1" then set A_induct to 1
2 L" v% \7 {% i* r2 _2 Z        else if A_tote="tote 2" then set A_induct to 2
; e2 _7 ]- R1 x+ y; Z9 S' n% V7 y            else set A_induct to 3    8 {* \5 ~6 c' c* H& z) {+ z
        set A_i to 0
* @$ Q3 O: [" G) [        clone 1 load to P_induction+ b; ?/ A# K1 b/ d0 C
        wait for A_time sec
# n9 _' H0 f! u& h4 a    end
" B& F+ v: b. {/ p) D. Xend: c) h- Q% j( O8 R% m
$ X* @+ ~5 L: w' w5 A
begin P_induction arriving
6 A9 q" P% R5 q    if A_induct=1 then clone 1 load to P_pick1# O$ }" C' `( {$ N7 h
    else if A_induct=2 then clone 1 load to P_pick2
) S; f; V9 w" J$ Z/ i# j        else clone 1 load to P_pick3# y9 J& C  x/ @! A$ ~$ x& W
end' q) b9 r' q9 h$ P- o$ i* e& Q+ n
" s+ |" v) c4 C+ R% X( o
begin P_pick1 arriving
# l/ d% M/ g2 H. t    set A_i to 1! C: u- e  {1 q8 Y. x5 M
    move into Q_induct1
9 n6 M) G" |" Q: g$ y: B* j% N    move into pickaisle.induct18 F/ j0 F; ~2 u) u2 t- ^, B. h& y
    while A_i<=30 do begin" b6 r* v* q% @; X6 w
        travel to pickaisle.con(A_i)9 |" ^+ ^3 I( r) c7 g" M( V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 G0 Z4 K4 a# j5 q9 c# \6 m        else wait for 10 sec. |' a/ `8 Z) J) \; k
        if A_i=A_leave then send to die
3 u" T3 _4 _/ }3 e# E: y! {8 g: w        else inc A_i by 12 z9 W9 E: o% I3 G
    end
* C# ~) J, C. W, {end/ ]6 Q: V6 \' E9 g9 f

# e* Y- i6 A8 c! Wbegin P_pick2 arriving
+ K3 e+ V% g" p    set A_i to 11: x- B8 G# p0 D5 g0 E1 Q0 o/ q& P' A
    move into Q_induct2& q' j& H( w! {- o8 @0 z4 Q- d, q) i
    move into pickaisle.induct28 {* r0 D9 o) O
    while A_i<=30 do begin
7 |% A& g% c2 T6 c( b        travel to pickaisle.con(A_i)
. L5 ~% k% G. l; U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 _  m) z, f0 X
        else wait for 10 sec
0 F( I( X& u5 |0 Q, Y# |& Z% V5 ~        if A_i=A_leave then send to die+ `" _. |3 t- Y
        else inc A_i by 1
+ P( n+ c4 m5 F    end( e7 ]" d+ i9 ?
end
: D# d- X  i; k& o
: |( g$ N- S: r5 U+ L6 N! w0 Xbegin P_pick3 arriving
: A4 b) R, x2 V% {+ B. J/ r# q9 f# M    set A_i to 21) z6 }2 _9 h& a) Z; X+ v2 L
    move into Q_induct3
3 q, k) x8 c- ?1 J( w    move into pickaisle.induct3
2 [& N3 [7 g( m; L    while A_i<=30 do begin
. j4 u: p" Y4 |        travel to pickaisle.con(A_i)4 B% J4 p' w( f" S2 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 ~4 {# v7 q5 d2 N- c* q; N7 J
        else wait for 10 sec
% h& t9 l$ r$ ~1 \" P        if A_i=A_leave then send to die
, }& |  z- E- j4 |2 P, U$ K        else inc A_i by 1
, M; h% x3 `1 |' \    end/ _. d0 ?4 S' R, M4 ]0 V. o
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 O0 z: P8 }$ i/ v/ U
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; H+ P9 H" {3 d; \+ q9 {7 W- X1 ]8 ~/ R. P, v: M1 B- @/ M1 o( p
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) F9 R% [$ h% Q% S9 h+ \+ a. W3 O

$ K9 M+ h* |. z) d另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
0 J/ l2 Q0 s# n1 x4 W, G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 W4 Q& m$ d& Z8 ?6 C) }9 I0 D0 S
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* Z  Q( n8 U6 R7 y3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 R0 [9 f8 I5 ^
begin P_induction arriving- J" x0 w" b3 d; \1 B
    clone 1 load to P_pick(A_induct): j8 B+ y- |2 u1 i2 f
end最大的系
" F, c- m) W$ X3 b9 }+ A8 \# E* w6 x2 {) n# {
begin P_pick arriving
& d9 q. y2 w. I( A    set A_i to procindex * 10 + 1
; e. l$ `3 V; E2 h# g% Q    move into Q_induct(procindex)
/ p3 b) r5 R0 ?# Q- D+ H    move into pickaisle.induct(procindex)( Z9 s3 C8 G$ ]* q+ Y8 J& i
    /*check the type of pickaisle.induct(i), for your last problem.*/" k; l# V7 G+ n! O) a" M

3 z- F6 N2 u$ Y; l, j' q6 \    while A_i<=30 do begin8 C9 o5 l$ f! V' T: I) C
        travel to pickaisle.con(A_i)7 L" a- j0 Q3 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( x" {7 B3 b& u
        else wait for 10 sec
: w5 [8 X/ c; a# ^- b, g2 E8 ~        if A_i=A_leave then send to die
+ D& X* E+ o  ?1 b6 |! V7 _4 V        else inc A_i by 15 J4 v" E# P8 w8 d/ A
    end
( d& w- x3 r! wend
$ C& V+ u9 W$ ~; \! ]3 t! [4 v3 J1 b4 s: j
其中的procindex为整形,代表当前process的序号。
7 T( b; \6 r2 w4 R9 Y) Y- Cstation和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-9-6 17:35 , Processed in 0.017435 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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