设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13667|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ M. ]1 Q6 _( f- R

3 C' k1 q; a) q6 U* R5 ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 y; B) C" N4 b
! A+ Z! B# h7 [: j2 _% J+ c8 l  abegin P_read arriving
( z  _/ L2 w1 y" ~& ~    while 1=1 do begin
8 O: Q; l7 [, i) j8 `7 T) Z2 J# `        read A_tote from "data.txt" with delimiter "\n"
% z6 @& w: W& P+ g& K& _( w        read A_time from "data.txt" with delimiter "\n"3 P5 v0 @$ Q5 L$ ]3 r" L$ A
        read A_leave from "data.txt" with delimiter "\n"
4 u4 n. o6 z0 \% r' O9 _        read A_picks from "data.txt" with delimiter "\n"
3 J9 B$ l: x$ U" g        set load type to A_tote# A# o/ b8 D% i( k- u' ?5 E
        if A_tote="tote 1" then set A_induct to 10 E& X9 H+ ~2 y' q+ @6 ]' n2 Y
        else if A_tote="tote 2" then set A_induct to 2
+ T- J7 y; ]6 b8 w4 O            else set A_induct to 3   
) e7 v$ T+ m- X1 a3 I  S        set A_i to 0. Y% ?! S/ g5 l( [
        clone 1 load to P_induction6 `  i  a9 A2 M- q
        wait for A_time sec
8 `* E. K* c! u3 T5 {/ F    end
( E/ a5 Y) w' ]end- O& }" D% I" v4 U0 O- V

) C& d- j/ g( \begin P_induction arriving+ I- I* S3 G9 u
    if A_induct=1 then clone 1 load to P_pick1
3 n: N/ ]2 U- N( B& n3 I    else if A_induct=2 then clone 1 load to P_pick2
# B. Y* J, l, h" R) [) t        else clone 1 load to P_pick3  l& e) f6 r# x5 R4 M$ I
end
7 y* {' P+ ?% |6 L: c5 C% Z# [( d7 [7 |( @4 i% c  Y
begin P_pick1 arriving# i7 @& ?) U0 R& i) p  d# h
    set A_i to 1! C( @! S6 I- p( \
    move into Q_induct1
( g5 L8 ]$ D4 p( q1 G4 r8 U, ]    move into pickaisle.induct1
' C/ b/ k. Z" ^5 H) ?    while A_i<=30 do begin4 {/ E$ N! F: h5 o0 Z  d
        travel to pickaisle.con(A_i)0 \& u: O5 Z# F4 f& _6 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# ?3 t& i/ x, C3 j, y2 H
        else wait for 10 sec
3 O/ H7 o% p/ W        if A_i=A_leave then send to die
/ `! Z( z0 W% ?1 [9 h        else inc A_i by 11 ]+ ?0 |. a' s8 Y7 m
    end) C4 {( ?5 X3 f, V. T! l
end: A" x* ?. g$ [

6 o7 }* p; e( u  _4 l7 [begin P_pick2 arriving2 Z, s9 E) s) m2 Y4 W  P: s
    set A_i to 11
3 a* R5 w5 t: }3 q  S    move into Q_induct24 E7 U( R( y& @5 o- O- u
    move into pickaisle.induct2
: J! P  l9 ?& v/ X* O7 \( R3 _    while A_i<=30 do begin
" J* r6 D4 J! W$ g, j* e! [        travel to pickaisle.con(A_i)
2 w" s1 S: O. o! G: C! a2 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- y7 {: C- H. i8 u% p        else wait for 10 sec
. p5 O) b8 e! G/ o4 l6 ]) R( k, C        if A_i=A_leave then send to die
$ K/ @6 m' v2 y+ A1 U4 {; c        else inc A_i by 1$ L. U) [3 m9 r: }5 f9 q: Q$ W" W4 f4 s
    end9 L/ S3 P8 I0 p: y
end
: I+ H2 d/ w* d. m. d+ R6 C7 R  g/ N
begin P_pick3 arriving
0 M( Z  b4 Z1 V    set A_i to 21
8 p5 E% t6 d3 [5 M    move into Q_induct3
- X$ D+ K( }1 u- i. c+ c    move into pickaisle.induct3
. G, O. {& s* _8 \( @' P, D9 h    while A_i<=30 do begin
: y- a: p  @1 a2 f  M        travel to pickaisle.con(A_i)
! U+ M* e9 @% Q' @; h0 I9 {5 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# S5 v- M" h1 j! \' ~        else wait for 10 sec- v: v6 T7 w4 V0 z
        if A_i=A_leave then send to die! o9 s$ ]% _" r  _% J/ `
        else inc A_i by 1
' I4 P' ]$ a5 {! ^    end# A+ ~* O8 s, J& v
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是个什么东东?
* X' f- i4 y* ^: U) Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
5 H. p5 M4 x8 Y+ y4 ]
/ x6 j% G& @, m4 eAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 [2 M0 `# e/ d" O! I
" |% d) v$ @$ ]
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 s5 }+ |  ?' @# K1 E: l1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ E: R  t/ ]+ z  L! T7 G, r5 n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ ?7 B& N* a0 p9 p& C' s3 s& }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: o; g. @* F: j0 a) Y# zbegin P_induction arriving
: h, F, [# O8 X, l    clone 1 load to P_pick(A_induct)
2 G4 x4 k3 D% I( {# u& Dend最大的系. k8 A' p6 c& e2 l9 w
: \+ F; F& K/ k
begin P_pick arriving
7 l# u3 d$ d9 ]' B# \( z& N3 h    set A_i to procindex * 10 + 13 E) J6 I  ]% n# R
    move into Q_induct(procindex)
: i4 D0 V; q5 ?; [. X    move into pickaisle.induct(procindex)  x  r1 p6 j& K/ @+ @
    /*check the type of pickaisle.induct(i), for your last problem.*/1 s. H* i0 {' z  {: m+ _4 x- O

& j" s6 O; Q* G2 K, F% ~    while A_i<=30 do begin) ^, p6 r. s5 o- M% g
        travel to pickaisle.con(A_i)3 j8 b9 A% L0 I3 e! q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 n- Q% `' z% r, ]' [% X
        else wait for 10 sec
: T  p! }0 c$ k& R1 L: {        if A_i=A_leave then send to die
5 @" d. b! i$ @. G1 d2 k        else inc A_i by 18 H/ n7 D" V* M0 `) Q
    end4 G: G$ `6 j4 S9 H7 t) v
end
4 j2 _4 l* K: k# E2 d" ~4 C/ L/ I, t! w5 ~( W+ ^1 n
其中的procindex为整形,代表当前process的序号。& C6 Z. ]2 U- I+ f' a
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-4-27 16:46 , Processed in 0.016813 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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