设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11652|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 J; Y  x' C1 x- ]' ?" `7 c

. n  Z1 J# D6 x* Y0 \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( }5 L5 y2 N' s2 o  b1 h- Z7 b
* m. l5 W5 @2 X2 g+ Ibegin P_read arriving
9 x4 A; L7 U7 s5 D' N4 b! _! [+ g    while 1=1 do begin
& u, Y6 T- j' u/ g* T' \% y        read A_tote from "data.txt" with delimiter "\n"
! d# n) p2 u0 k* s! m2 y        read A_time from "data.txt" with delimiter "\n"9 g  ]1 _$ Z: L0 w! M. I/ T
        read A_leave from "data.txt" with delimiter "\n"4 r7 G4 G0 V2 U# O" {
        read A_picks from "data.txt" with delimiter "\n"$ G1 k- [4 A0 o0 K
        set load type to A_tote
5 Q8 y) e( @6 A/ ]. t- o  }        if A_tote="tote 1" then set A_induct to 1
0 ~4 \2 C( \! X* G        else if A_tote="tote 2" then set A_induct to 28 S* e$ a* H! Z* j6 Z8 ]
            else set A_induct to 3    6 {  p  u! m# w2 u; p
        set A_i to 0
  V' s9 P2 f! y2 l        clone 1 load to P_induction, l9 |/ y# E$ f8 N8 l
        wait for A_time sec8 T9 k! P* G/ ]$ Q( {8 L. {% c
    end# A0 N4 ?. x1 N8 a3 B
end; G: b' i0 y/ K! I9 |  Y' k+ V

% l! d# o8 \: ]& P" W1 r2 ebegin P_induction arriving
, f) s+ ?+ |' ~/ x. W    if A_induct=1 then clone 1 load to P_pick1
; l- X. E# r, x4 C6 F    else if A_induct=2 then clone 1 load to P_pick2& s/ v& T9 k& z& L3 ^8 c. O5 w
        else clone 1 load to P_pick3
& `& m5 [# b/ w( r  `6 Z* B/ D! ?end6 F4 v3 H  I. x1 A, A/ J

0 T7 b2 f% ^! @begin P_pick1 arriving! C! n$ B% v" p* `, f$ w2 G
    set A_i to 1
$ b" R  F' B. c% C. N: l- j: }    move into Q_induct1& p1 F) F* [" J( M6 q$ H9 b# o
    move into pickaisle.induct1
2 b( `8 |. v1 U. P4 r* T. Z) H. l    while A_i<=30 do begin3 T# R9 M6 b: e& W* p% ]
        travel to pickaisle.con(A_i)" ?' _3 P7 Z: ]! S5 |8 {! O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, i# k$ @+ J8 G, _$ _        else wait for 10 sec
8 V9 E9 K& N) D5 v- H/ {" u. V        if A_i=A_leave then send to die$ M+ t6 @1 `; _# t
        else inc A_i by 17 `4 K9 a% N$ D! l, C3 w
    end5 s3 O# ?- i- \/ I9 f
end1 t2 Q" x( k# [) |# p7 m* E
$ R$ B! U4 M; M
begin P_pick2 arriving
' u0 }# w$ Z+ a0 {0 `! [    set A_i to 11# y8 O6 `/ R7 q) ?  G7 Y! z5 g
    move into Q_induct2
0 {* `( U3 F# o" k! J% E    move into pickaisle.induct2, M' l% W% n% z6 @" o
    while A_i<=30 do begin5 g8 q8 R2 M. W
        travel to pickaisle.con(A_i)
" U8 o8 o$ R4 Z& l5 m: B* ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- @+ T9 g6 S6 _9 s
        else wait for 10 sec5 q/ E# M; ^7 a5 M: l
        if A_i=A_leave then send to die' h& l5 D! [) C" D
        else inc A_i by 1
0 t* m5 |/ A( P) X, T) K* i. ?! u    end
6 A9 T) L) n: Q3 Fend
, D0 x$ j! |7 m# g6 _# K* M" @2 a/ ^6 \9 }8 O
begin P_pick3 arriving
5 b6 T% k2 y+ n8 e: _' D+ R' {    set A_i to 21( J, [7 G. A: r) C4 p" w
    move into Q_induct32 B- ~) ]  f" f$ @8 f
    move into pickaisle.induct3
1 a2 s, i+ s: c6 `" W    while A_i<=30 do begin3 R4 s5 @# I0 f! B
        travel to pickaisle.con(A_i)6 }: N$ s8 z1 c8 }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 N& v: V" m+ u. G# d9 e: S4 |        else wait for 10 sec6 k" T3 z% t, {6 c7 |% n
        if A_i=A_leave then send to die- H4 f' p( r& ]/ P- N( P
        else inc A_i by 1# |( o5 g/ c- }% a9 H9 J& G
    end; f& ]2 T# z4 e9 ?" {& X% 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是个什么东东?+ s/ @% N( N) t4 y8 o' O
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& C6 M1 \8 Y3 F. {0 y& R; F4 E" F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( ^9 }/ @) |! {6 C! C2 X
* ~" K6 S9 b7 x7 D3 H: M# k, l. Y; L7 C
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 Z3 X2 @" _/ |  R+ H8 r& |( k& K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ ?1 P, \, P- W3 U. n/ f8 o6 Z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
5 t1 k$ j* I8 E# \' v9 s$ U( S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* @# R1 @. I5 Cbegin P_induction arriving
" W" e5 N3 o) ?% w# {* ^- o    clone 1 load to P_pick(A_induct)$ p3 S1 D# P# O5 W8 p" V
end最大的系; O" \1 p' p. E/ r
, U6 S0 A4 c, O6 Y0 ^
begin P_pick arriving
6 X( Y8 i# Q' Q. L    set A_i to procindex * 10 + 1
: \9 |' w  y% w( g5 t    move into Q_induct(procindex)  `6 s  n6 ]7 \2 X# F) M; ?
    move into pickaisle.induct(procindex)
( o5 Y* e' @! e    /*check the type of pickaisle.induct(i), for your last problem.*/
8 m* B# I$ J% B  N' C% B0 H, j4 b
$ i% n7 }2 I" W9 B! c    while A_i<=30 do begin
9 U' a4 k; G4 `! Z4 i5 k        travel to pickaisle.con(A_i). e) R0 l/ \& y5 f* y2 v% d( ]$ J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  f  Y  V* o4 G2 d3 j3 j0 t, K
        else wait for 10 sec
  E- ^, Y2 e9 H& q2 `$ t+ Q- P; y- O        if A_i=A_leave then send to die# Y) l5 K/ J. }2 K
        else inc A_i by 1
; J9 C0 O1 ?, |: H    end# `/ v& ]7 g! c$ M1 W( r8 ~% H
end
9 e! m# E! \+ q. O/ X
% z& L& Z( U% J5 z9 y其中的procindex为整形,代表当前process的序号。5 L/ p# W+ w0 W, v* g  T5 l9 ?
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, 2025-11-25 22:31 , Processed in 0.016189 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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