设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15000|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' w" ?% P# W! f' ~/ }  ^' J1 }9 q6 M" N. f6 J  v7 v/ J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 h4 L* ~4 I4 e) ^0 R# k/ N! [
begin P_read arriving8 A4 U# H0 T4 l1 o8 I
    while 1=1 do begin
( _: @, M; f! |" N        read A_tote from "data.txt" with delimiter "\n"7 t. }6 \6 P. i
        read A_time from "data.txt" with delimiter "\n"
: Y/ r+ I) Z* b+ d+ v. W) u        read A_leave from "data.txt" with delimiter "\n", S# {3 C% c. @  F+ m1 L( |
        read A_picks from "data.txt" with delimiter "\n"( d$ _# d& D: ^! U
        set load type to A_tote
6 T3 {, I& X+ D; C6 S        if A_tote="tote 1" then set A_induct to 10 S6 p" A5 H9 w+ T! M
        else if A_tote="tote 2" then set A_induct to 2
/ }- c( g0 J" _2 K            else set A_induct to 3   
0 O" b* i) [1 y+ i7 w        set A_i to 0
$ ]( G3 C8 z- h2 n        clone 1 load to P_induction8 P( U! K& [! P8 r% K
        wait for A_time sec1 n8 z. S& \& @
    end
% ]2 I, b! C% E" @end
. }1 O1 Y+ w. h: S) y) v7 _" H4 c
begin P_induction arriving. ?+ B& ?) v7 V  f
    if A_induct=1 then clone 1 load to P_pick1
4 c; ]. y- j: \' D    else if A_induct=2 then clone 1 load to P_pick2
; P  I3 S% s) ^) ]        else clone 1 load to P_pick3
- a+ {; |  t8 V* |end
5 o" f" [( D% G& N  l% Y, v9 s- Y2 E
* x9 d$ K- i4 U# I0 b: Obegin P_pick1 arriving
0 V' I! L" e+ F: u) e: ?, x    set A_i to 15 Z' C8 c: F5 [7 h, k* a
    move into Q_induct1- S! `/ N6 d: S! P; [! T
    move into pickaisle.induct1
* H! E! x1 y- Z. g- I0 w4 Y    while A_i<=30 do begin% o0 o: }6 y2 b8 E7 ?
        travel to pickaisle.con(A_i)
7 b  O* p8 g9 |0 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 `) I, d  u+ L$ l" S/ w$ L  y  X
        else wait for 10 sec$ w8 g2 T7 Z7 C8 X/ x3 \
        if A_i=A_leave then send to die
% r' t% I9 |% q        else inc A_i by 1$ X; b- [# v. c
    end, p! ?6 \; @  \! O3 t; L
end
9 g/ u7 z: L( u2 `) W! J$ b- R) [4 Q* [1 {! A% c7 R
begin P_pick2 arriving
3 v) M6 |$ s* u& O! u; p' f    set A_i to 11
$ c+ c, g5 S! r: |: f2 U1 Z* f    move into Q_induct2
8 p& @/ N" J$ \, ^    move into pickaisle.induct25 q: v2 r) W, t9 N: d$ _0 V9 F
    while A_i<=30 do begin
1 n: L2 \; y. r; z0 v- U# k        travel to pickaisle.con(A_i)1 J0 Z, T& s% N6 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 p/ f$ U* Q& h; E& _; ~# G        else wait for 10 sec( {4 m  d( Y* i% s( ?
        if A_i=A_leave then send to die
6 V' O& t( U5 o& F( J        else inc A_i by 1& b7 J6 q: @2 j6 F' _
    end- C+ r  R0 S) i6 Y4 P) \
end  x* b9 y' u; s& |! M5 M; ?  x

5 y$ O1 L5 g9 r" A8 D9 Bbegin P_pick3 arriving
& g4 h! j; L7 r  i& q    set A_i to 21
" H- d8 x! `0 x/ W' h2 c7 g  v    move into Q_induct3- m& k! X% k! o* T
    move into pickaisle.induct32 y: q& {- S! n$ J8 c. H
    while A_i<=30 do begin' m) n2 {2 O9 J; R& ]$ }( \
        travel to pickaisle.con(A_i)6 u6 B9 q# ^9 A  @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 F& M6 y# m) A1 a7 {        else wait for 10 sec
% ^6 h" o" r  R. o        if A_i=A_leave then send to die
( T  \( `) d2 ^, u* B# z0 W: n* i7 Y( N        else inc A_i by 19 J) n% C5 X9 R
    end
9 M! g, Q4 U/ q2 Pend

最佳答案

查看完整内容

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是个什么东东?
8 i; }- F; l& D" r& y3 Emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 A9 V5 f+ z7 I8 @6 c+ ]  i. r

/ T( h: W! `# Y1 h1 |7 MAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  ~# v- H, u5 J& v
: I! |# O5 X! i' s% f& M( d
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# G& ?6 t8 b3 z* b! g1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, [% k* ~+ U) i+ r8 Y' k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. b" J1 p- L2 \5 S3 A! _
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 u' P, I( p) N/ v/ m" Xbegin P_induction arriving6 C# T7 U  ^) f  S" G6 B3 `
    clone 1 load to P_pick(A_induct)
7 o/ b9 q" e4 Z9 L1 Pend最大的系
: `" b: Y, n; @" H1 E1 d
) }4 K, s" {. Q: e! a. P7 Dbegin P_pick arriving
1 K8 ?5 Y' X' ^- u5 Y    set A_i to procindex * 10 + 1
* I" w0 l9 B- x0 |    move into Q_induct(procindex)! S0 W- D; }# o  O- R
    move into pickaisle.induct(procindex)
% \, n0 S+ G5 j: r2 s9 Y- i    /*check the type of pickaisle.induct(i), for your last problem.*/( ^& A$ K$ Z( t7 I

0 W2 G9 j7 L: j: X    while A_i<=30 do begin; J% A( |9 \  y9 H1 {% i+ i# ~& u
        travel to pickaisle.con(A_i)" |# }0 X9 g$ ]4 m8 p$ F& i& x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% y: L+ s8 C0 \+ Y        else wait for 10 sec
1 e# e2 G; y7 `' A6 ?! ^, _5 g        if A_i=A_leave then send to die
! ~. E+ g( ^  x        else inc A_i by 1: T! w$ [  S+ L* z' \  X
    end) D+ I4 A7 L3 _0 C3 r
end' y+ E5 Y* U# F' c( z$ l& O
4 p1 M! l6 R( n( x$ U4 m
其中的procindex为整形,代表当前process的序号。' C+ h4 z- r/ Y  P
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-8-3 04:40 , Processed in 3.079763 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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