设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14185|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( L+ ?$ V5 g2 g  D8 u8 S  N. I3 i! v3 A, R9 I, L
我的问题是,在每个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 @# a3 m4 U' n* j& S' p, Q/ N1 b! j4 X9 y: R, e0 J
begin P_read arriving* }* d2 \; B' m( L- s6 z
    while 1=1 do begin
, S- a1 N6 z; s3 B! @. i        read A_tote from "data.txt" with delimiter "\n"
8 V. i$ H) Y6 _2 ?# z$ V        read A_time from "data.txt" with delimiter "\n"
$ w8 {0 a5 ?" d# f( l# S        read A_leave from "data.txt" with delimiter "\n"
1 W; S2 A8 ^) d8 r% {& T! @8 o  A        read A_picks from "data.txt" with delimiter "\n"
2 h2 f% N: w+ A% Z9 V        set load type to A_tote/ }: n) h3 E: A! Y9 ^
        if A_tote="tote 1" then set A_induct to 16 [! N6 Q% ^  i6 _) M& N" V
        else if A_tote="tote 2" then set A_induct to 2
) {3 K" y5 f7 r0 v" s$ ?            else set A_induct to 3    7 Q8 I4 c' H+ \9 P- h7 a6 V# D
        set A_i to 0
0 C: Y9 v9 y& b9 {, {+ Q" L$ n+ P        clone 1 load to P_induction
+ t! Z" @2 P& `; R' J4 r6 ~: h        wait for A_time sec, h. X% P/ O" |
    end/ k: I& E4 r) O( V* U) X# u8 U
end
6 h! Q9 G) z; j4 f0 W" Q, Y& O# F, S, b7 _. ]  _" A
begin P_induction arriving8 T) m. ^; ]" b. ~- D" D( X
    if A_induct=1 then clone 1 load to P_pick1
$ X( i6 D* `6 I- M6 J0 t    else if A_induct=2 then clone 1 load to P_pick2
- J- v) i# c& f* _        else clone 1 load to P_pick3
3 ~9 u/ d9 J/ Uend! H7 B# p# T; E/ J5 u3 o5 J
6 R5 x% {/ h8 }8 w+ H! |( h
begin P_pick1 arriving
2 `, T3 X3 C3 l! Z8 j    set A_i to 1
1 l8 [5 X$ X) l9 U  G# b    move into Q_induct16 Z8 F# |' G) X$ \' ^" ]  f' G
    move into pickaisle.induct12 o" T8 t" [- }! E! O( d& F
    while A_i<=30 do begin0 c0 t9 i$ U0 t! A5 {$ B
        travel to pickaisle.con(A_i)
" s3 Y) Z* S; @+ M( ~! P$ J# R- L% w2 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' U0 X  X# d! b) b6 Q( g        else wait for 10 sec
$ ]1 z4 j# g1 _1 r3 ]& {        if A_i=A_leave then send to die
  @! N3 n1 C* @- g        else inc A_i by 1
1 H% ^2 B. _. ?; s3 Z' f    end
; a7 d( u* V. cend% L0 J" J8 R' z+ A! v

  Y, x& g8 W" R1 z% Cbegin P_pick2 arriving7 G' r5 t7 s* }' T
    set A_i to 11
2 v4 g* r! Y3 M1 w    move into Q_induct2
, Z) L* v% W9 u, G- r  u    move into pickaisle.induct2
5 q) c0 h% t+ c- }: V' {: |: T    while A_i<=30 do begin
# m. G0 z9 R' p' v, V        travel to pickaisle.con(A_i)7 X( j; r! u( N+ d( p4 D9 l- C6 E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# B( c" l5 L2 q' |0 B0 q        else wait for 10 sec' q. d# v2 N& T7 n
        if A_i=A_leave then send to die& r! h7 ^  I  ]8 Z( V
        else inc A_i by 1
. X% S3 h+ b% ~  x) T; p    end
/ {9 y2 h+ T# \( ?* i! E; M. ^end, G/ L6 \4 b2 w2 W! J" m% l
  ~: x$ p% a7 c9 w1 U" x$ v2 Z# m
begin P_pick3 arriving
1 Z- h9 z6 y+ B# X: l% R    set A_i to 21
% n+ W# g3 X% b) ?) }; z; p    move into Q_induct3
6 j, W5 x% \' a% L& U/ A  }    move into pickaisle.induct3, j; Q% [! u& k' ?8 T  [
    while A_i<=30 do begin
1 \& F; i" b$ {9 L  r6 s        travel to pickaisle.con(A_i)
7 n3 k/ K  w; K+ n" Z% Z6 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; c  C  Z" n+ a: ^. w. a        else wait for 10 sec8 a; i+ d2 H" l3 Z
        if A_i=A_leave then send to die
. Z% w6 F3 u! W4 a2 R- p. ^+ B        else inc A_i by 1
& }! E" `3 n, V. ]7 r    end
" d4 z4 @, @2 a1 L9 D2 |% O0 Mend

最佳答案

查看完整内容

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是个什么东东?) h# r+ a3 Z0 G& k1 f) {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; G7 w* @- c# i4 P: ~
$ e5 r7 [' T# m4 g# `AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, i# ~: r7 e# N9 o4 {6 o& s# b/ _. o; X: N9 `# C7 I' n
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: k! {; j! t4 ?4 e8 _- K% D+ K6 f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 w4 W& A$ \" n* Q1 \, {
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 E6 b- R2 F. [- D! W3 j, |. y) o8 i3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:8 ?/ h$ p' O# u2 y$ V1 {
begin P_induction arriving+ E4 B  l* {* x; f" f' a$ R# R
    clone 1 load to P_pick(A_induct)6 i/ N  L, K4 G. ~9 h: [
end最大的系
4 \* ~& t, \( K. P' l$ u! U7 b* R" |6 X! }, D$ g2 ?
begin P_pick arriving$ g; H% a5 U* W' H
    set A_i to procindex * 10 + 1& j2 l# @" E# ?; \$ x, v
    move into Q_induct(procindex), O2 v6 x; V- _- Y
    move into pickaisle.induct(procindex)" z; C. m) }9 _$ t# H+ b* l
    /*check the type of pickaisle.induct(i), for your last problem.*/+ a- v* n3 y+ {) r: e! W" R+ q# F# H  Y

0 p6 Q: o7 J% y" \    while A_i<=30 do begin
. T, t7 ?1 d9 G+ n        travel to pickaisle.con(A_i)
4 y! u! q' |5 Y0 F) q4 v. |  H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 c$ r4 a, Q9 A
        else wait for 10 sec
: B( f5 m) F4 R, g1 t! S# u" U' q        if A_i=A_leave then send to die
- p) l- ~2 Z9 s        else inc A_i by 1
1 ]* j; ~0 Q! \, i- z  K    end
! C8 j9 y, S& v. K: @) ~! O8 c" {end
4 {. z2 ]+ Y! z" E" H
5 D) `' `5 P5 b其中的procindex为整形,代表当前process的序号。
5 ]& }! Z- P+ H0 c7 g' c, Astation和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-18 10:25 , Processed in 0.015574 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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