设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13986|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% q. x7 b+ K. U3 t
9 f5 |8 E! `& U6 h( x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 ]% _. n, o! T+ L' G8 h3 G$ K; b$ t' ^* o0 E$ z) g9 ]9 g: O, L% r
begin P_read arriving9 F. }5 Q( C0 b0 v& f  B/ T
    while 1=1 do begin4 e0 x# ~  G' d  [. Y
        read A_tote from "data.txt" with delimiter "\n"6 g# |+ w  N" j) ]' s
        read A_time from "data.txt" with delimiter "\n"
5 K7 H1 T* Z; R4 C( ~- ?        read A_leave from "data.txt" with delimiter "\n") v+ O" V4 t9 s
        read A_picks from "data.txt" with delimiter "\n"
9 v$ A7 t5 h1 n: f% U0 `        set load type to A_tote5 b+ ]6 m( P  Q% E0 a
        if A_tote="tote 1" then set A_induct to 1
( w& t. A- F8 ^% j. t6 d, l        else if A_tote="tote 2" then set A_induct to 2
+ V/ h0 O2 g& j# Q( ^            else set A_induct to 3   
7 Q2 X& E6 f9 u        set A_i to 0
  L  _, @& A% f9 `. d  ^        clone 1 load to P_induction
2 D2 s, c# J3 W* Z6 S        wait for A_time sec
1 m8 n9 A2 q+ r; |    end
) t3 @' Y. g- |0 r3 H) cend6 x) R4 l) K% r
% r: ]( }2 P0 d  Q  T; R  s+ `
begin P_induction arriving
$ O/ n7 S% D# M1 s$ }0 D; G& ^    if A_induct=1 then clone 1 load to P_pick1
; |$ L8 w2 r) m    else if A_induct=2 then clone 1 load to P_pick2
- e$ \' D2 C* V: H4 a2 }, D4 ]% a        else clone 1 load to P_pick3: a0 H( L- k3 Y% @
end
/ P3 ]/ r( R1 o, K8 s" s6 h8 I1 k" _8 a; E- Z8 k
begin P_pick1 arriving9 e8 G0 i0 Y3 ~6 Y5 u" @
    set A_i to 1& ^2 x1 J/ p' J* ?" ?1 O  r0 L; {
    move into Q_induct1& T, u) e% z  Z7 M- ^
    move into pickaisle.induct1
. o* Q  A+ e; `3 l2 Y    while A_i<=30 do begin
1 o9 \* @6 P7 ]) U        travel to pickaisle.con(A_i)/ w! E4 J& Q" H, S( [# e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 z% ^! q! e& G9 D$ H" S        else wait for 10 sec- D+ U2 i: a1 `8 N2 ?
        if A_i=A_leave then send to die2 A8 G& m+ i, w3 X% [
        else inc A_i by 1! H* H/ z; M( N
    end! C! `7 P' K" g* X
end
$ k4 Z- ~- }& Z( C* O; c- |
' A) D8 {* O- U6 A  X) ?' }$ ybegin P_pick2 arriving0 E) |% a  d; d. F# j
    set A_i to 11# D+ P/ ?' X+ L7 ]9 G  U9 J' N
    move into Q_induct27 W8 q& |8 g/ E0 O' L; H# a5 m
    move into pickaisle.induct20 C: P3 q/ Y- r8 _7 [; U
    while A_i<=30 do begin
2 S( _  y# `- L( I0 `1 P% L2 q. i        travel to pickaisle.con(A_i)9 m: m, ?: W/ i' Y+ u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ l/ w) Y5 S2 |) \% c3 Z8 v
        else wait for 10 sec) a2 W. V/ K$ `: Y
        if A_i=A_leave then send to die
3 F' e( h6 g4 w% k2 R3 F+ g% e+ H        else inc A_i by 1
- C  G7 s/ l$ R    end5 l9 `! Q3 ]% Q# S! E& p. Z1 ~
end) J. f6 r+ k3 D; |  D
; t2 @& h/ o# V1 N) L% [
begin P_pick3 arriving
5 s! d9 w/ Q: `; U* D& k    set A_i to 21
! A0 ?1 ]9 [/ ^2 t" u; B    move into Q_induct3$ m& ?% |" s* C" i9 o; a
    move into pickaisle.induct31 n3 @3 q/ g3 b9 W
    while A_i<=30 do begin
- J/ q( i5 X1 K' y: ?% n. H7 T        travel to pickaisle.con(A_i)# G6 L* Z& x9 F4 Z' h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- P0 s" B' a$ K' ?7 Y: I$ L5 ?" c        else wait for 10 sec
. Q0 t. R; H' W; b( A        if A_i=A_leave then send to die1 q: W8 P' Z5 ?/ m9 j) ~5 s
        else inc A_i by 14 I+ t  L& C7 ~; d6 a
    end2 C9 }' E) }: b
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是个什么东东?3 l9 ]4 K9 g9 w) Z( U# X( W% c
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, r+ r1 j" o4 g
- T9 V7 V& i; C; F) i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( B! R( j6 o2 [
- [6 d# s& Z% D9 P另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; p' t& g# J& }3 e7 {
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 u$ q; {8 E- f  ^: j. U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! Q1 g8 V- F, i! q' y0 p. k
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& W- E5 r7 R; C5 lbegin P_induction arriving
6 u, v& P/ p2 q2 Y4 y2 i7 M    clone 1 load to P_pick(A_induct)
. R  p. [' C9 jend最大的系6 z7 Q1 M- J: B! N% ^4 C
4 M, P* k/ B% n2 K
begin P_pick arriving
% J- q0 M2 x5 b1 D    set A_i to procindex * 10 + 1
) H5 z: H" W" b6 n) U& ?, F    move into Q_induct(procindex)
3 W6 |- ^) m. c    move into pickaisle.induct(procindex)
: q6 {9 M+ M7 P- ]' _2 m    /*check the type of pickaisle.induct(i), for your last problem.*/
7 M! {- o2 d! x
1 p6 K( v  x% z$ p5 P& K    while A_i<=30 do begin$ g9 ~/ j0 c/ [! W; R9 F! v
        travel to pickaisle.con(A_i)
7 C8 ~( @. ^  X( B: b/ K* H7 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. b7 B, E4 m& B2 c! S
        else wait for 10 sec
7 j& _& G  b$ j        if A_i=A_leave then send to die
7 q/ u) w7 }0 \        else inc A_i by 1$ S$ Z. f# X2 J( D+ f9 J
    end
! r! C4 R2 ]) P' c0 v: Kend
( z; [5 I5 H4 X$ F
% |1 v% s1 h4 P1 m其中的procindex为整形,代表当前process的序号。6 I4 B. t; Y* q
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-5-27 12:00 , Processed in 0.020224 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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