设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13908|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 x" l$ t6 {, c% x3 m) h1 W& w, s) S1 C$ ?1 ~8 ^# w- 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中的数值,不知道会不会有什么不妥。
; @. i# z3 m- V, P9 g5 I; W+ K* m7 a$ }7 B* g1 S5 k! ^3 m: [5 Y
begin P_read arriving! O  B: t* O- Z' L( `
    while 1=1 do begin
1 h0 L% W. p" a0 J( E* H        read A_tote from "data.txt" with delimiter "\n"
: c# y2 c8 e' }/ G/ [( L; D6 m) M) `        read A_time from "data.txt" with delimiter "\n"
1 J, y" t! S* j& i  @; w# x        read A_leave from "data.txt" with delimiter "\n"; B% ~- u: U. m9 B
        read A_picks from "data.txt" with delimiter "\n"4 @% F7 G+ M7 Q( T+ D2 |
        set load type to A_tote
1 B' Y+ j; j$ i3 @. h: |        if A_tote="tote 1" then set A_induct to 1
( p9 \6 S- W* I, N        else if A_tote="tote 2" then set A_induct to 2* v& ~- T9 }6 y. f% Q
            else set A_induct to 3   
! U1 ]7 i" ?  V9 M" W+ j        set A_i to 0
: P6 i% t2 e9 w5 C6 O        clone 1 load to P_induction( H3 ^/ T" c1 B1 ?) K) c( {
        wait for A_time sec
% F; ?6 h4 O, L! c    end
8 n$ k  `7 E2 C) iend
3 r  h( V+ O2 U. v8 y; I/ O! F1 w6 Z$ k, d
begin P_induction arriving1 @5 W" J, p2 r) c$ {" s
    if A_induct=1 then clone 1 load to P_pick1) g' Y5 u. s; g, U
    else if A_induct=2 then clone 1 load to P_pick2
- i* E1 Q* w6 K4 n( i2 v        else clone 1 load to P_pick3& O; ]. R& i2 x3 V& b# z
end
# g/ Q$ I1 s1 D  K2 D1 `# ]1 N: U* a9 s2 o% ?! D' c& v
begin P_pick1 arriving2 w1 e# X, D/ L# L
    set A_i to 1! p1 z: {$ W" G% t! i8 ]0 G( {; G
    move into Q_induct1
! Y' j' d/ P5 q; M1 U2 S+ e! Y    move into pickaisle.induct1" O3 n, x2 v; C" p* V8 u" e9 t
    while A_i<=30 do begin: Z' M1 N; X# y* e. q/ ]3 Y
        travel to pickaisle.con(A_i)3 w8 X* P: w" M. g) y7 z* h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  {. v! W9 J# t7 E) Q
        else wait for 10 sec
% T- L9 U/ ~$ ~/ X. m3 Z. H        if A_i=A_leave then send to die- @3 @: j- s+ _
        else inc A_i by 1
) {" ?- @$ H& n) ^. _& _" g    end: t2 G5 l5 `" E
end, B5 ?- X* W' z6 s1 H- G# f4 f+ F

0 |; g4 G2 L+ u% h  K8 `begin P_pick2 arriving
9 ^- g( t+ g3 ^5 M( D1 }7 t    set A_i to 11, W# ~, r' [& Z5 o3 U7 e
    move into Q_induct2
: Q" y  b5 T; l& \5 E6 {( L9 |$ Y    move into pickaisle.induct2
& Z9 ?& o$ {5 S) e+ h* Q    while A_i<=30 do begin
6 y" {2 C2 I! m        travel to pickaisle.con(A_i)8 }2 E7 X  e) c" U) ^# T+ b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: R$ s5 q7 j+ H2 l5 S) ^, K& c
        else wait for 10 sec
% K/ a! L  F' I) s        if A_i=A_leave then send to die
) G! C" |9 I4 ~        else inc A_i by 1& V( w. Y8 T. r4 v* Q
    end" z7 T& |) W( H0 l
end- s7 f/ [2 Y* t4 A% l# K' \

" d( U, U/ y. C3 N+ k% Z( Zbegin P_pick3 arriving
" E* Y0 d8 u2 t; R/ \; C4 b    set A_i to 21
( r/ h, P+ s$ _+ ^- B# z( }    move into Q_induct3
) x% a9 ~/ S* w* m0 z  l6 N    move into pickaisle.induct3
! R$ x0 w( h2 P9 e: j- ?/ P    while A_i<=30 do begin" o4 g' l) ^' @2 `
        travel to pickaisle.con(A_i)
; {, B2 t/ j5 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' ~( [7 C$ a4 j0 O* U' {5 \  x        else wait for 10 sec
: Z# \9 Z( B2 M, J        if A_i=A_leave then send to die$ o3 L3 }0 I$ R8 a, A$ i
        else inc A_i by 1
. W5 [# T. l8 t6 Y! v$ Y1 Y    end3 t3 r( @) |/ k
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* o+ D2 K. O9 l* W
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ j3 P% K. `) d3 L9 V8 p6 c  |2 ^; W
7 C5 S6 l' [' \  w! E) v9 @( Z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: a0 ?5 |% R2 I1 m7 m* P$ m& ^
2 E6 T' N/ O/ n: G% `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# q5 z) P  r' z1 W$ E6 d
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 X# m# n! Q3 J: a1 a8 P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, D# B& _& C. M' C3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 D$ Z3 z. T0 g' Y; r$ _+ D- Pbegin P_induction arriving1 K* l: V. b4 ^% h) {4 ?/ a
    clone 1 load to P_pick(A_induct)2 k& S' }+ |/ u$ r0 w
end最大的系! y+ w! }2 i/ g. }7 E

2 d* l; @7 Z5 a6 {begin P_pick arriving/ K, H0 \1 Y0 f  B; U
    set A_i to procindex * 10 + 1
0 T# Y; k9 U/ @: U9 |/ W    move into Q_induct(procindex)
8 B& M- q2 W4 }! q4 H9 t    move into pickaisle.induct(procindex)# B* N. L" h4 _7 _% L
    /*check the type of pickaisle.induct(i), for your last problem.*/  h$ `+ u1 [4 P8 |7 N# ]# H

& B4 F3 a8 l& ^( l    while A_i<=30 do begin
* ]7 Y. o2 [" y7 r0 x6 g) f& w        travel to pickaisle.con(A_i)
3 z  u6 j) u4 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" m& k( \$ w4 r' E' c' X        else wait for 10 sec, l- G$ `) ?/ {
        if A_i=A_leave then send to die
- v$ L3 ]+ W( C& P        else inc A_i by 1
' k9 s  c4 Z2 O4 X; ?: j    end
7 A+ f; J: p$ z( U( B& eend. ^0 F& u" S9 u

8 I, E% L; t$ x; e其中的procindex为整形,代表当前process的序号。
4 T, V! q, l; b+ v* gstation和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-5-17 22:05 , Processed in 0.021866 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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