设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15520|回复: 2

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

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

* H: x* B9 z* w  @: n我的问题是,在每个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中的数值,不知道会不会有什么不妥。
  ]& h; c* p  H. J
& f" S$ R3 I9 m+ lbegin P_read arriving, J: u; J, f! R9 i& R
    while 1=1 do begin: E7 E- N# f( Z; |: T0 D
        read A_tote from "data.txt" with delimiter "\n"
% U, h" J& s! H4 Q        read A_time from "data.txt" with delimiter "\n"
3 Q" y5 ~# P, _8 B7 {! S& ]        read A_leave from "data.txt" with delimiter "\n"
6 w7 _! ^" o6 ?  C        read A_picks from "data.txt" with delimiter "\n"0 I. S$ D2 h6 q8 J8 k9 e. ~8 V9 B
        set load type to A_tote
1 `# ~4 _6 u3 w8 Q6 H' ^/ \# b        if A_tote="tote 1" then set A_induct to 1
; f/ G; o# {  ^        else if A_tote="tote 2" then set A_induct to 2
& M5 ]1 O- s' U+ }4 ?$ n            else set A_induct to 3    . y7 Z2 S& F/ K- h
        set A_i to 0
8 B/ s* t5 e9 r! r        clone 1 load to P_induction
. U% O1 I  Y" F: V        wait for A_time sec1 f. {& l4 F) w! l7 l
    end
* ?* L  t. ^0 A: P7 N$ _4 Xend
6 k4 H' L- C6 M9 F6 j: r1 h* j, ?) p2 d, Q/ u3 k1 H
begin P_induction arriving, v: b% t/ I* S: x! b3 |
    if A_induct=1 then clone 1 load to P_pick12 ^- e/ O: _9 ^. c& W
    else if A_induct=2 then clone 1 load to P_pick2
% A" ~5 ]  o+ [2 v+ g" t3 Y        else clone 1 load to P_pick3# _: b' ^  I7 J% p; h% @  A& i7 Q( k! o
end  j  X6 H6 r5 J* K3 _9 P9 Z
7 L- G' V& N$ \" n2 H; `
begin P_pick1 arriving1 d) H6 W+ g' U, x/ |
    set A_i to 1
! O6 B# p+ K4 T4 O# a4 [    move into Q_induct1
% y$ j/ o. R6 K# B6 g; ~    move into pickaisle.induct1
" F) |, w5 S' `  j0 F' ?    while A_i<=30 do begin# @0 f- G  c5 F# y/ T- f( x' S; z
        travel to pickaisle.con(A_i)( d& T* E7 K( r! [& k. N" j0 ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* Q5 x4 A7 t) O8 U5 F- j# M        else wait for 10 sec' k" e7 J8 e9 z) ]$ c: |
        if A_i=A_leave then send to die
; W- k% n  p3 K/ t. ~& T# E8 I$ ^        else inc A_i by 1, @# W1 u7 b, y' B8 C
    end& K5 @; m1 q$ l( ]$ d# U
end) p' ~3 p- X' I* g% J% m# e3 b* E3 f

9 S, G; u9 P, s, C* Y( hbegin P_pick2 arriving4 H. C4 B1 }, U/ w5 F
    set A_i to 11! x! h% G2 w. |% b
    move into Q_induct2) d6 s& j, K! |% l
    move into pickaisle.induct21 l0 o) i3 e  r9 r! G0 ]* o
    while A_i<=30 do begin+ `0 a' f1 {7 m+ D" @
        travel to pickaisle.con(A_i)7 _& ]) O- q6 Y9 U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. S+ h& _1 p4 w  Y6 q# H: m        else wait for 10 sec& e* Z# G+ q( C. p* W  E
        if A_i=A_leave then send to die6 A3 ~! C- I% o
        else inc A_i by 1
: d4 i1 Q: V! k1 j) Z  M    end
6 d0 S7 Y; z# S. P8 ^6 C- Nend
5 I2 ^3 f8 c1 `
3 s3 }% X' t- Z/ q0 rbegin P_pick3 arriving5 v: H6 w  f" R0 S
    set A_i to 213 D  ^0 t% _, a! u; p' \' c
    move into Q_induct39 z1 T8 k! l3 P) n
    move into pickaisle.induct3
& `) D0 @4 V+ q    while A_i<=30 do begin
* L3 ?- N% K6 [/ n1 I1 H% D        travel to pickaisle.con(A_i)7 f1 L( D- M, T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) e1 o3 m/ w5 D$ @  k
        else wait for 10 sec
" \$ E7 J; T  I: M( m* G        if A_i=A_leave then send to die
2 o/ r3 G4 q8 S% ^/ j4 B" i# q        else inc A_i by 14 B$ l0 x( X! U0 b3 o- Y
    end& O- ?0 s+ t/ Z6 Z% e
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是个什么东东?( m8 `' Q  C" y% V% p
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 ^( `* u* E. Y2 i* \6 ?
6 L8 q+ g& H" s3 C5 dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- w; N: h& f, G2 X/ O% A) u  w; U
/ T7 P4 y5 x5 T. L- Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 A1 ^9 T/ T# i9 l! l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 F8 z$ Q! V8 N2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. b( Q6 P# ]: u# u( x. J3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 l. `9 K) P% \% @5 g6 Z4 {: j
begin P_induction arriving8 r# P0 }. L7 v' {5 p
    clone 1 load to P_pick(A_induct)
2 g3 m& z& j/ [. |0 Mend最大的系1 z) k8 _, U( [1 H0 E& n$ U
) M% i8 d) I+ R8 g% p
begin P_pick arriving
6 k) _% f7 {) w# i/ j: ]4 I7 f7 ]3 U    set A_i to procindex * 10 + 1
' L) A) l5 U: l) l0 u    move into Q_induct(procindex); O* w5 G- Q  b* ]9 ?
    move into pickaisle.induct(procindex)( E4 h! G0 p( P& q* t
    /*check the type of pickaisle.induct(i), for your last problem.*// @. H) V: C1 }& N$ a
8 |0 X( v; k5 ]7 o
    while A_i<=30 do begin
# S5 e) g1 k+ \, J        travel to pickaisle.con(A_i)
  Q1 \1 M) K) c0 V) G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ L* d8 U/ ]& z8 ?  |        else wait for 10 sec
) H$ E0 s' g% T& J+ S        if A_i=A_leave then send to die5 C" ^; V" r/ F5 A
        else inc A_i by 1/ r; V7 S) }9 ^/ j# n8 \
    end3 D$ \8 C8 Q& u- C( h/ G
end
1 C* ?7 j4 {, `. d6 Y& m' S1 t1 T, _! M7 \6 k6 V) O
其中的procindex为整形,代表当前process的序号。7 S5 V0 {, c$ i/ f: [* a: C
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-9-17 06:46 , Processed in 0.020014 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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