设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15064|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- t, P( l' M  z4 r
5 V2 y  g. S5 `: C9 A; [9 b我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ `1 i' s: i4 X# @; b9 t; J; ?: M' z5 T; j7 W7 b7 x- x5 t+ A
begin P_read arriving& o9 n  s0 ~, f* E
    while 1=1 do begin' W4 I! B0 p8 K( P
        read A_tote from "data.txt" with delimiter "\n"9 y: r0 l6 M" o
        read A_time from "data.txt" with delimiter "\n"
1 k/ a8 f, N2 [6 a        read A_leave from "data.txt" with delimiter "\n". `5 F4 a. V2 e- d5 b3 ]& F( }
        read A_picks from "data.txt" with delimiter "\n", W! u. _2 ~. J. {+ Y( m5 o
        set load type to A_tote
" x1 s" s8 \: }$ l$ i        if A_tote="tote 1" then set A_induct to 13 K/ E- q: ~8 t5 [* M
        else if A_tote="tote 2" then set A_induct to 2
: ?; U. o; T1 @) Z- n5 X5 `            else set A_induct to 3    & W% c/ e  Q- ^. L% d/ Y
        set A_i to 0# H; H( f. r" m
        clone 1 load to P_induction8 o5 j* [( ~( M% w
        wait for A_time sec3 e3 K2 o; j: u# F
    end
/ M5 L  _6 ]3 t& o: M! mend
/ M6 i0 a9 _3 l+ L4 b' p4 r9 t$ c. n) ]
begin P_induction arriving: @  U- p0 A" f6 ?2 m% @8 q
    if A_induct=1 then clone 1 load to P_pick12 Q: P  _8 {; K2 t& T' E
    else if A_induct=2 then clone 1 load to P_pick2
( T2 v( j2 f* G; l        else clone 1 load to P_pick3
( r, w: e3 t/ Y9 u6 g* r2 ]: i8 ?end# e% J& j7 x) |& C, d; U* n7 B
. C% X& G4 X& z/ `- N
begin P_pick1 arriving* {6 R& |/ H( m
    set A_i to 1
0 s( z+ |8 \3 }    move into Q_induct1
$ y1 y. ]0 g0 M) f    move into pickaisle.induct16 Y9 P" v+ Y9 P* m
    while A_i<=30 do begin
6 ~. W/ b4 h6 @1 K: B! [        travel to pickaisle.con(A_i)# P, Q% K! p) h. k) V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. F+ B# D# V: v0 N+ o! j        else wait for 10 sec! P0 J( i1 V! d$ |% n
        if A_i=A_leave then send to die
& E$ Z" T# e9 g6 L/ k+ H% h8 Z! `        else inc A_i by 1  L, N4 @6 M8 k8 \. S' s) r
    end
6 I4 o: r! u; `: a8 O# y3 dend: i1 N8 n& F6 D6 t
! C: Z# c3 Q& b) Y3 U  N$ O4 `
begin P_pick2 arriving7 E9 S3 m4 i4 r( W$ T% A% {# F0 V
    set A_i to 11
2 g- F8 I( x! ^( B    move into Q_induct2
" |! @4 ?: }) A3 u    move into pickaisle.induct2
; c, G/ ?. m: M9 `    while A_i<=30 do begin, A2 H1 t( F" y+ o! P
        travel to pickaisle.con(A_i)
0 b" @3 n% J' F4 Z7 X2 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. D- C+ h7 T2 ?: G
        else wait for 10 sec
7 M$ f2 P$ q( l6 m* F        if A_i=A_leave then send to die
8 u7 T  B1 N/ i. b        else inc A_i by 1
$ K) i% o( h  J1 }# [    end5 {; ~, g% D' w
end
* h# b1 S$ U% j1 B7 X: ]7 e( z/ v8 P! q# P, U
begin P_pick3 arriving
. b! d8 [% U6 P4 a4 o; n3 J    set A_i to 21
  F- t5 {2 N" ^4 r" ?    move into Q_induct3; _: T+ T6 J  T" Q6 \
    move into pickaisle.induct38 N( X7 p( x' B: K
    while A_i<=30 do begin
0 v: r6 }. W9 D+ `4 P, @5 f8 `        travel to pickaisle.con(A_i)
$ l$ X! K$ I' T& K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; z9 L) h- X: z% S        else wait for 10 sec+ i6 [" I# C, W$ c0 m- u
        if A_i=A_leave then send to die
- u0 i) t, t# Z' }9 F        else inc A_i by 1
9 T% B: M. }$ o3 P5 F    end
6 ~8 d, A0 H0 ?7 p( j; M! Wend

最佳答案

查看完整内容

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是个什么东东?# _9 r" H9 K! L& P0 o: \
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: Z, g, _  V" _/ r
. x- |9 F- w: H+ ?2 G/ s( }; UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: v( u2 t! d: ~0 [- k
9 N# {) z: b' ?6 i/ V; Z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 C# P' W' ^8 W' S( h7 a1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* E" a' ]! W" F2 f$ R3 b1 H3 H2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 w9 t9 T1 R! i" d5 `3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  j1 h$ k  }- m, H/ D. T5 O
begin P_induction arriving
) N) E6 }# k9 V5 B: X! e. h, ~* u    clone 1 load to P_pick(A_induct)/ x$ Y; K2 w; @7 I/ ~
end最大的系5 K- i/ M1 k9 u4 A9 k  O4 s' e
+ I9 F" T! c$ v. N; Q# L1 |
begin P_pick arriving
, {. }) Y: m0 D, E' `    set A_i to procindex * 10 + 1
; R1 y6 a- B% F    move into Q_induct(procindex)# Y0 D  Q# e  g% j* Y" C% z! I; G5 E
    move into pickaisle.induct(procindex)" O! N; P1 f8 g& p$ T4 H! Y2 E# ]
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 @/ l, u# Q9 D5 G; H" G' d
/ K5 }! u+ [7 _! q) K( |    while A_i<=30 do begin
: X+ k. \; B7 r/ ~# m; t, `" {/ ^. q        travel to pickaisle.con(A_i)
% j! y6 Q6 F3 {1 _  X7 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! f1 |! U# L2 t% u2 r        else wait for 10 sec. i2 Y. q, Y9 f/ B  ^" v: ^: [. V
        if A_i=A_leave then send to die
: a: |% U! o. t        else inc A_i by 19 a  @- o, j; j3 J
    end
9 \3 m9 W: P. R. _6 H! f: Q* o/ |end
% |) j3 c) X0 n9 h4 J) v/ p$ [/ f+ l$ {
其中的procindex为整形,代表当前process的序号。
, k4 U( B  d. z& ^5 A, Y" E/ Z! hstation和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-7 10:18 , Processed in 0.028570 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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