设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15530|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. w# ^7 G+ w. g* l+ p" B

! S- ^5 |% o) @1 P* P) Y1 i我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ C( Q; W, C/ N, v. X( }# g1 i
  f% U6 r8 v2 g( l! Z$ hbegin P_read arriving, G2 a- \+ Q8 d! U- w5 L
    while 1=1 do begin
: q: l" p+ P. k/ l% x. r        read A_tote from "data.txt" with delimiter "\n"- K  m4 a$ W1 U  C6 u: G
        read A_time from "data.txt" with delimiter "\n"
5 b2 x( c/ e/ b. _1 }% H$ [        read A_leave from "data.txt" with delimiter "\n"
( S8 M; z% f7 \6 D, |        read A_picks from "data.txt" with delimiter "\n"+ K$ S. @# D4 Q5 J  T
        set load type to A_tote* m9 j# q, G& G- n# e8 s# ~, [  s0 g+ n
        if A_tote="tote 1" then set A_induct to 14 n1 T5 C+ z0 X4 B6 y0 G, S
        else if A_tote="tote 2" then set A_induct to 2! i! R* C7 W( Y) c* C
            else set A_induct to 3    0 Z8 ~7 C8 h2 p5 K. E# ~
        set A_i to 08 r6 p9 X4 A, S5 V1 k8 U% G
        clone 1 load to P_induction! M2 l4 r4 d  \: L( d
        wait for A_time sec* g5 h2 [8 |8 ]6 S
    end3 n. @+ {8 P, }( o+ ^2 `5 z" v
end
& J: X2 L- U$ l/ I+ Y
3 ~' w( [, a3 C  X4 rbegin P_induction arriving; p2 ]  a7 V2 S, t7 Y/ e" {
    if A_induct=1 then clone 1 load to P_pick1
- g9 c( F! R) {. X9 \% W    else if A_induct=2 then clone 1 load to P_pick2- T8 l% Z4 W+ f" y3 l' h
        else clone 1 load to P_pick3
- @" o' i2 w: B. T* F3 V, ^/ c% fend2 i7 x* x; k9 g1 B; x# F7 E& @

% j/ y- ~+ t4 ]2 J* u, h  ?begin P_pick1 arriving
, g3 ^" K9 `7 O4 I8 A. Z1 d+ ?    set A_i to 15 q. L( Y; \: V
    move into Q_induct18 _* x0 J; I' a" U- y
    move into pickaisle.induct1+ K9 L( h, {7 X  N6 z+ k
    while A_i<=30 do begin$ v$ D3 Z% b) [8 B9 K$ R6 Z& R
        travel to pickaisle.con(A_i)
8 g3 x$ B, C/ V* Q0 @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% r6 X# M( ~. }# A, r$ e        else wait for 10 sec
+ g, I, `7 O- w: \+ X" v. s        if A_i=A_leave then send to die
6 P( c* F; |( P1 H( T) M0 _( e        else inc A_i by 16 _& H6 I& O6 e  Q. \, q: [
    end
6 Y; s, ~/ k! k6 o3 Dend
5 `7 M" c2 R; t  z: G8 N% ~8 C" l, o) _+ {* m% `
begin P_pick2 arriving# l$ V3 `4 n1 J$ P1 x% X( d* N
    set A_i to 11
- D$ T2 s+ S1 s9 @9 }    move into Q_induct2- f: R3 F+ Z* V" Z% v( M! `
    move into pickaisle.induct2" T$ C; m& f- H0 {) A
    while A_i<=30 do begin
: k" {8 m0 T, Q0 d5 z: W        travel to pickaisle.con(A_i)9 ]/ M% O) M" u! D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 }4 h; d, p; Q9 g; J
        else wait for 10 sec
, R) b+ E& m* U, q, G8 F( w8 V$ I        if A_i=A_leave then send to die, v, K3 J3 C+ V# m! z, i  Y
        else inc A_i by 1
* V! o* U/ n3 ?! L& q" X    end
8 Z$ k" |! ~0 n: nend1 c# Z) n/ l  w4 M  Z

; H% ~  v( V5 X, gbegin P_pick3 arriving7 x/ y9 `' o  T. o! k" Z
    set A_i to 21
1 p! |' N: q3 q4 s  |; {    move into Q_induct3
" T, n; T4 E6 U6 _4 E$ k    move into pickaisle.induct3
) o4 H  Q7 Z) R( w    while A_i<=30 do begin
! H" E3 ]; a1 ^" ]2 M        travel to pickaisle.con(A_i)
% V: q8 @, l7 y, w3 Z9 s) y- X) q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* v( F9 |3 I& ~5 p
        else wait for 10 sec$ _- a# T: \# {
        if A_i=A_leave then send to die( f4 G& ~. F$ T# s- ~5 y
        else inc A_i by 1
( s6 A/ P. G, {2 n6 A, s  L    end" J( c4 \3 S8 s+ i- N  p! {
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是个什么东东?
5 q, Y9 ~+ l( u" l" nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 G/ @7 o8 ?8 C
" j* W2 D# o+ B. a1 ]: rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ Z2 m+ w* M- e( T9 W. O7 W8 w

# u2 {$ t3 {5 h; M1 n4 _另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% w% c7 C& k, v1 a9 `) {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  U$ m5 S/ s' U, `+ Z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' {& \* g2 g# R2 L" M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:$ `( e6 e6 u# x3 n2 [) [) m
begin P_induction arriving" i3 w5 s3 w0 g# L' u1 Z) _
    clone 1 load to P_pick(A_induct), t- P. Z9 o2 W
end最大的系: G/ Z- t0 B# f

7 F5 w! |9 L( m) C; ^begin P_pick arriving
( C0 k4 e6 a+ {9 ~7 ~. A  X    set A_i to procindex * 10 + 1
. o3 m; Z1 {7 t' {* M    move into Q_induct(procindex)9 x2 C% l5 v, ~' K/ P6 H2 Y2 b
    move into pickaisle.induct(procindex)$ @/ k8 U1 }" A" i
    /*check the type of pickaisle.induct(i), for your last problem.*/
; Y  D+ H8 Z( M0 Q' j8 W7 z0 Y; k+ k  m# J
    while A_i<=30 do begin
; f0 U4 e& k0 Y7 f! o. S        travel to pickaisle.con(A_i)% |: r% i2 i8 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' K% b; e8 C! Q0 a) B        else wait for 10 sec
3 U1 ]9 X' p; [, g        if A_i=A_leave then send to die  N7 }% I1 N9 @* {/ ]% k* n
        else inc A_i by 1- I" V/ Q7 J. e$ k8 ]4 r8 o
    end- \6 F0 W2 V- l. [3 K/ _; m! ^$ h
end
1 N* _3 _1 t& n  I6 x' a( p; D5 X
" l$ P4 @' `( V7 X$ a+ U) M0 H& Y其中的procindex为整形,代表当前process的序号。( o& c# I( E, A7 C. b7 ?
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-18 03:13 , Processed in 0.022323 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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