设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14695|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* X: k6 i; W6 b% @8 G5 w2 x8 w, _& x  b+ h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' u2 ]! N' {, o, n& j# l
. m$ a: Z3 {8 }  ~/ g9 F$ _7 n
begin P_read arriving7 P/ p$ v* \* m6 m* h3 r
    while 1=1 do begin3 \$ y3 ~% I9 e% E1 O4 [1 N/ Q1 I
        read A_tote from "data.txt" with delimiter "\n") S& x$ w  \3 J7 U- [" Z, n
        read A_time from "data.txt" with delimiter "\n"/ J; s6 s* I: S, [1 k
        read A_leave from "data.txt" with delimiter "\n"3 s( J* ?! {# q  s- M
        read A_picks from "data.txt" with delimiter "\n". z0 g# U2 ~9 [0 O$ y
        set load type to A_tote
" x0 ?* s6 Y/ L8 O) y. I$ @6 |        if A_tote="tote 1" then set A_induct to 11 D0 r+ [' h1 \8 ^+ U
        else if A_tote="tote 2" then set A_induct to 2
/ T/ B* F4 I4 ^4 x' s0 y) R            else set A_induct to 3    0 p7 b  E1 T( F# [
        set A_i to 01 T9 Q! `- N2 x  S
        clone 1 load to P_induction
/ m/ A7 O/ D: _1 |9 Z* c        wait for A_time sec
/ c& r& _( e6 m6 K. `- T    end
1 A8 J3 {; x# q$ r; Mend9 R: \: l3 t# S, ?1 z7 k
, E$ f' L: B4 F. s7 x( s
begin P_induction arriving
' Y+ X; Z9 [  P) N7 u( u) I    if A_induct=1 then clone 1 load to P_pick1! f+ d$ r. Y; l& f3 e7 l
    else if A_induct=2 then clone 1 load to P_pick2
' }* g. x2 a( q1 O        else clone 1 load to P_pick3+ I( j/ Z. f  |6 b
end
, h( F1 D- ~. \# A, k8 q$ s8 G1 z3 w) _; T5 `. A5 C: u
begin P_pick1 arriving
6 o  k0 Z/ P% d1 V) k- `    set A_i to 1
+ q# ~/ w$ u3 N4 p7 F    move into Q_induct1
9 i4 h9 W9 j5 v" O  j    move into pickaisle.induct1  o! S5 F! Z) z$ A
    while A_i<=30 do begin
# `' ^9 [/ i  n: M3 F) h; ^        travel to pickaisle.con(A_i)
1 q2 H6 s' N  K( b1 n. w$ d9 ~# I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 T. p3 @6 U/ _1 y' C        else wait for 10 sec3 x9 e0 @% W+ f  c/ n' h
        if A_i=A_leave then send to die
6 z* R5 J  P" B# \- c& A. Q        else inc A_i by 1" g. }0 D6 h6 U( k4 M8 s3 F
    end
/ j( C+ c9 u8 J( ^6 W/ i) \end( U; H$ Z3 }' t

& j. x3 o( u# g4 o. h" ~& xbegin P_pick2 arriving
* o2 p: a: W# n9 x( u    set A_i to 111 A2 G- K7 M7 t$ [
    move into Q_induct2: m- L/ R; j7 w' |# R
    move into pickaisle.induct2
( S- S/ P6 C6 a! W* e4 D) q% I    while A_i<=30 do begin' O6 [' Q- \" M& I9 G7 d# A0 z
        travel to pickaisle.con(A_i). @4 K6 A' Y% ]5 R4 x' }0 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# c+ @7 K, \1 X% p) R; F
        else wait for 10 sec
* w3 ?" j- i& D, l9 n! I8 `3 g        if A_i=A_leave then send to die
/ R& B" \+ P+ z4 e        else inc A_i by 12 [! L5 d: R* x) y2 K. U2 Z9 m2 r
    end
( O9 t7 h1 r+ m) S2 B' M+ P2 y+ Q, qend; v3 h) o( {  q7 K( Q
2 i. m1 f& a4 M& n' A3 j
begin P_pick3 arriving$ W& M3 U- c: ~
    set A_i to 21
# x( Q1 D. D; }, |7 x: O9 H    move into Q_induct3( Q& ?2 [, O* N8 m/ n0 J2 ?9 x
    move into pickaisle.induct3
8 j- U: p. R# [' K+ m  J    while A_i<=30 do begin
4 i+ n; J8 J& v& @* D) l' n        travel to pickaisle.con(A_i)
# E) G: Y# P( s+ D3 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 K2 {  B+ B$ `* ~+ F$ K0 e        else wait for 10 sec
) Z. J2 ^! e2 j- K* u- Y        if A_i=A_leave then send to die' O  @# o$ N1 [& R
        else inc A_i by 1
" t4 C2 W3 P7 }+ m2 T/ U' t' l. E( }  y    end6 n6 n. [# P1 J. n/ k8 x* h0 K3 t
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是个什么东东?
6 h, R3 M/ F1 W' mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( @# D0 v# V0 S3 L
: S# P9 {- c0 ]: }) ^6 y) C# N) IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" A% ^( {/ l/ H% l6 M8 E: Q5 B6 X

2 K/ ]2 D9 U) [% a% v$ W9 B2 b; i% ^; C" z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 m5 m; j5 F/ D1 K3 X7 S. ]1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- S8 \6 u, B; T1 k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 U, F* |0 O$ g6 Y2 i
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 ]5 D- Y- d' i% d& I# e$ Z
begin P_induction arriving+ g% c$ r0 R) q3 _! b3 m8 ]
    clone 1 load to P_pick(A_induct)! ?9 W! V( f1 `4 e, B9 ]. x
end最大的系
% t, G1 ~. a0 e2 h
/ ]* W8 L  e4 A, T; ibegin P_pick arriving
3 e0 ^1 V3 q3 P% Q6 ?    set A_i to procindex * 10 + 1
" J; O8 X+ H# x4 j    move into Q_induct(procindex)
/ |: Q. e( `! t4 A% T    move into pickaisle.induct(procindex)
% M5 ]' ]* [' u6 ^/ R, H    /*check the type of pickaisle.induct(i), for your last problem.*/) I5 _8 Q5 j6 @. s1 @

0 c; u0 Y# L. P" y7 ?  \) B    while A_i<=30 do begin
+ T9 j1 Z& K, S9 M- Y        travel to pickaisle.con(A_i)
( ?2 U: L, W& m3 {8 N3 h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 P  t4 I7 l  a
        else wait for 10 sec$ f6 e+ R7 j! s5 f# I
        if A_i=A_leave then send to die$ }" o$ ^4 L5 {$ g7 K
        else inc A_i by 1
, A% L' P  L0 R    end  M+ L% T) m8 ?2 Q* r! u  D
end
; r5 Z5 K$ A# S: L# U7 [3 x) [! f8 \9 n  k
其中的procindex为整形,代表当前process的序号。
: \; E! [- z* C) fstation和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-7-21 19:25 , Processed in 0.015087 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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