设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14920|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 Y& G# j: ^5 ^3 r7 H; z7 t8 n
0 x$ R+ }/ ]* `我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ o+ i3 r8 K7 a% x% @; Q7 @  F
, E/ d" ?$ N" I& c/ x3 Q( ?begin P_read arriving
+ x) q* F! k% G2 l    while 1=1 do begin6 ?3 t* j: {) g
        read A_tote from "data.txt" with delimiter "\n"+ p2 a/ ?7 _8 y. k' ]: C7 R
        read A_time from "data.txt" with delimiter "\n"+ w. S3 ?9 v  W
        read A_leave from "data.txt" with delimiter "\n"
$ j5 M+ V( Z) Q; @, E        read A_picks from "data.txt" with delimiter "\n"" }7 G" n. A- i% L- H9 C2 R
        set load type to A_tote: v( d# ]) m# n; l: I) e
        if A_tote="tote 1" then set A_induct to 1
' w% l' L3 z1 y  T        else if A_tote="tote 2" then set A_induct to 2- _) e" G# e5 g9 s, Q- x
            else set A_induct to 3   
" @7 A' k3 d- S3 N/ p8 G        set A_i to 0
& W8 s. V' A" g6 R        clone 1 load to P_induction& ]% j# v. A1 F) X& L* R" G0 `
        wait for A_time sec
, q" Y$ M9 P( M( j2 u  I    end% N. r6 d3 Z& q  R: S1 v
end% |% \+ B( ~2 G3 B# _/ l
0 P! W; e* c# u' _8 r) V
begin P_induction arriving! v5 S! f& t7 X* d4 R/ @
    if A_induct=1 then clone 1 load to P_pick1( m( o! v! G4 k2 L8 o. {  ~
    else if A_induct=2 then clone 1 load to P_pick2* l" J  Q" f4 K5 m" y
        else clone 1 load to P_pick35 w, W! \8 [/ j. B  D7 C1 m$ c
end
4 O( I) t, G0 {9 y& Y7 A* W$ g
; T1 D9 s! M% o/ L4 R0 rbegin P_pick1 arriving4 e+ Z( q' o  \
    set A_i to 1
' p; V9 Q: T8 t( s) f) o    move into Q_induct14 O/ b: A, E5 s
    move into pickaisle.induct1
3 N! q# d, l: F7 ~8 Q0 G    while A_i<=30 do begin% O. ]* F- ?4 G8 K
        travel to pickaisle.con(A_i)
" f9 l1 j0 ?, h) z& n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) k  P) _( _8 n& ]        else wait for 10 sec; t+ Z5 a9 c2 v! T% p+ _
        if A_i=A_leave then send to die) u8 [+ r3 F8 Y) z& L$ ^
        else inc A_i by 1
6 m- t' P2 w' }- T# H" ?5 x5 @    end! X0 Y/ @& @2 b1 B
end, N7 t0 j+ @# r) _2 T7 c% X

; u8 c% {! V: d% Vbegin P_pick2 arriving/ G' U1 p8 k* `' h: T7 d) [/ a! ?; `
    set A_i to 11
* z4 j; H- L* [& j2 S    move into Q_induct2
( Z; y( D5 ?; N. R0 t8 q6 c  t    move into pickaisle.induct2  j, b: B. \" R# K: ~; U, @1 [* Z
    while A_i<=30 do begin- c( G, _* `9 e
        travel to pickaisle.con(A_i)6 t( O& [# x. M6 @& R! V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 w. D0 c* v/ M7 A% u        else wait for 10 sec0 l* S' U2 \* c4 f6 j+ Q* T2 A
        if A_i=A_leave then send to die
8 F# @3 L: `: ^        else inc A_i by 11 n. D' W7 J+ f" a
    end
1 G& {/ {+ f0 D  l, U  b7 z+ r2 @end) J$ T8 ~2 r; g  h

8 f( \* b2 E) s% P7 [: k: `begin P_pick3 arriving  S9 C+ o, ~- I
    set A_i to 21
6 p$ [# f: w1 l+ O3 p5 X    move into Q_induct3
% K0 c) ?8 g$ k8 g    move into pickaisle.induct3
* R" @% C) s7 z( ]. V2 D2 d8 U    while A_i<=30 do begin
) v: a& Z2 h" @; K; ?        travel to pickaisle.con(A_i)
' S8 W: k+ s; ]& S) T1 h: Q8 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ R  u5 ~/ O% v. T# |- ?5 W$ N+ _8 H
        else wait for 10 sec
/ [! G9 S: I2 m, \: c" }        if A_i=A_leave then send to die
$ k' D& E3 {$ ?( _. r        else inc A_i by 1
- Z. e6 _5 h% R; [; u9 W    end1 w3 K/ Z" g9 X( q$ G
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是个什么东东?
7 J4 ?7 i& K8 A) Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  n  C: ?1 Q! b7 B: I3 n
# }/ ]+ \' Q& [3 x9 t" p! s+ s4 h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ l7 D3 }- V5 K, P" @, A# _. D  u( g# x6 G* H4 }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ t& s7 k& X- l, Q1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. ~$ B. U( ]* _9 P! e4 {, X2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) s9 X9 G7 S2 q; K; v! L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: F* f% n2 p6 F- K+ q! hbegin P_induction arriving
% A. A0 K' D/ e3 h7 N% ^. d7 R    clone 1 load to P_pick(A_induct)! J# u1 ~/ Z. ^8 `( S5 a
end最大的系' p5 ]. F, B* i; Q% N7 `* D2 a

& x; O1 o0 a; j6 b3 y) d0 Sbegin P_pick arriving
; p+ X6 O% c: n: L# u    set A_i to procindex * 10 + 1
3 K& W" v7 H1 \8 U( J    move into Q_induct(procindex)* M1 v' a; {: Q9 Y
    move into pickaisle.induct(procindex)
- S) v( M5 k& U3 v0 |    /*check the type of pickaisle.induct(i), for your last problem.*/
& m3 A  @* {1 L
6 n5 J  e* z* J, a4 U    while A_i<=30 do begin
/ y5 ~( k2 O, z" c        travel to pickaisle.con(A_i). }+ b. t0 \& d& m! d2 g0 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 J5 ~! E9 [3 y: A! k2 k/ T
        else wait for 10 sec" I: o7 e, o- j1 d# |" F# U
        if A_i=A_leave then send to die
5 B6 z6 }1 R9 |, H/ }8 y0 }/ r  ]: ~        else inc A_i by 17 G0 E. j  F" }7 r" N% Y
    end! `& p9 G" z4 n  w' u) Z% F+ K
end
+ D- c( a  r- s' e" H' A4 X" ^5 [- [/ k8 u" n, f7 l' a
其中的procindex为整形,代表当前process的序号。
" Z' V" g/ C# q* ~" X: N9 V" Bstation和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-31 16:54 , Processed in 0.017807 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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