设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13947|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 ^( `3 w9 i0 w) \. D3 ?$ V
$ d$ |; N: U: E& s5 {5 v4 \我的问题是,在每个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中的数值,不知道会不会有什么不妥。! _" G4 B. Q$ j& ]. f* k$ ?8 N. Z
0 B) i# A) K- o; i* O
begin P_read arriving6 s6 [, N0 n: F) i* |& k
    while 1=1 do begin
: j, u6 C- _9 d' D9 L9 u        read A_tote from "data.txt" with delimiter "\n"
1 X+ j' d' M. U& B5 ?        read A_time from "data.txt" with delimiter "\n"
7 g3 R' |4 ^+ N% o+ P        read A_leave from "data.txt" with delimiter "\n"" d; n' m) |0 ~# K4 ?
        read A_picks from "data.txt" with delimiter "\n"/ F, @/ g3 \3 M+ `' N6 |& `# b# H
        set load type to A_tote
' c: A1 c8 o' K        if A_tote="tote 1" then set A_induct to 1% l: X5 i% ~: V1 G' y
        else if A_tote="tote 2" then set A_induct to 2
6 a! X- }% r+ p2 q            else set A_induct to 3    : E7 k* B1 L1 _2 Q$ S6 Z6 ^
        set A_i to 0/ o1 g) h1 |9 U& w  s6 S0 W0 }
        clone 1 load to P_induction
: |# d- V3 I, l/ \        wait for A_time sec
* Z* e: x" F( Q2 v  p2 H% V    end
) }+ n/ @4 c, B* _0 Q2 C8 {end% D4 J6 }' A4 H4 S# A
1 Q3 Q+ t$ G! U0 ^  O
begin P_induction arriving
; e' Z' ?$ a2 ], N# h5 w3 z    if A_induct=1 then clone 1 load to P_pick1) ?* R- F6 A9 T% p6 m
    else if A_induct=2 then clone 1 load to P_pick2
9 X; z$ p( e; w5 d. R0 A        else clone 1 load to P_pick3( I' h' q  e! {: o; W
end4 [# t5 Q' f( ?2 y5 x

8 D% o' N+ J$ e' sbegin P_pick1 arriving: Z$ W3 ]* Q6 W! e( M
    set A_i to 1
+ }  y  T9 i) o6 d0 I4 Z9 s5 v    move into Q_induct1( m1 k* U/ ~$ v
    move into pickaisle.induct17 X# i2 X" K: ?: U4 {( d2 Y
    while A_i<=30 do begin
# p  u; W, Y+ J5 \4 Z        travel to pickaisle.con(A_i)- n! c. M+ C" B; e- F& b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* x# R, D( J3 Q% r        else wait for 10 sec
4 G, S" f8 s' q: Z) s) |4 k+ o7 g6 p) v        if A_i=A_leave then send to die& F: e3 l3 a: \" K5 n0 m, c
        else inc A_i by 13 ^0 _, t6 V4 V) t6 ~  B* t, I
    end, V' E( q! E  {  w5 c. r/ [+ D
end8 d$ X0 E% ~# k6 r( m

% ?8 s7 _9 W) d9 g& h& kbegin P_pick2 arriving
! g! q$ |: y% a0 a    set A_i to 11
; F& U) a* f6 [+ W  ]2 I    move into Q_induct2; A; M  S# o' i& f2 z' c# Y
    move into pickaisle.induct23 J( l+ k. }- c9 `% f7 B
    while A_i<=30 do begin4 \7 Z$ i& d- d! K6 \
        travel to pickaisle.con(A_i)0 E7 z9 U3 N; o4 A% H  [+ _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 Y# H- \( N4 P; }; ~  d; L
        else wait for 10 sec
( s7 p/ {0 d9 D0 k        if A_i=A_leave then send to die
1 N% w8 V5 I4 D1 y2 y        else inc A_i by 10 N1 B, ~5 y! W& o9 @
    end
. g+ Y# L5 w8 T/ Hend5 G2 t2 c( E9 `& r9 l  P
, K- e, L5 p1 `: Z! O9 }
begin P_pick3 arriving
4 }  H. P, B* y) l' x. B/ R/ k0 q    set A_i to 21
  l3 w( Y% ~2 _" S! ]1 D' M. J    move into Q_induct3
6 H$ _2 x/ v! O; N0 q- t; l! }    move into pickaisle.induct3
) k6 T# q! ^0 Q* _' g    while A_i<=30 do begin
0 A2 P- N3 Y7 E# {7 w) H# W, ^        travel to pickaisle.con(A_i): l7 w( `) I! H( |' {8 |& G$ B9 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 C. W! q3 m% L( _
        else wait for 10 sec
$ @7 j% G1 P5 @$ _5 g$ @4 \3 s        if A_i=A_leave then send to die4 o; A6 @+ H- d) h  ^1 j" b
        else inc A_i by 1; U  A& g. L# E5 O8 y) R  `
    end
1 N) r* z& J" `: ~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是个什么东东?1 j) L; u+ F4 W; p1 m8 B7 N2 h; `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( x2 a1 a6 P) r* Y
; h# k2 ^; O6 C6 S2 e# {5 ?+ ]
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% A4 e  P5 B7 p( O1 m$ p# b1 U1 e0 D& N7 z. [5 q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; {+ d& Z1 S5 g8 X" n1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;6 b& y; O* y, E) N+ x" V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 u: h: I, b9 B. P6 g8 m9 ]) W3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; X  a$ V; I1 v6 J$ i+ B- P) q! ybegin P_induction arriving
7 N" d5 C5 w$ p# m    clone 1 load to P_pick(A_induct)
8 r) Y* [0 @2 vend最大的系
) ]- O4 M9 g6 @3 o3 G% R
( a- M" _4 t9 s5 I7 B7 {8 D" ]0 v* Ibegin P_pick arriving
# Z. S. x1 Z* X$ u. w4 F    set A_i to procindex * 10 + 1  K9 b+ t" E. ^4 [8 K
    move into Q_induct(procindex)2 s( x, x+ w$ \! P! S( b- M0 v$ U& F
    move into pickaisle.induct(procindex)
% r+ N% A6 ?# U. d( p4 @. I    /*check the type of pickaisle.induct(i), for your last problem.*/# }% B; z  C4 d$ v. F. T+ X

- \8 s7 H) L5 Z+ S# B& n    while A_i<=30 do begin$ c* q- U3 C; M2 G4 h$ r. N
        travel to pickaisle.con(A_i)
- v+ k2 u( Y$ E2 Q% p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) i; ?  @; a& L! d. w
        else wait for 10 sec
, g0 j3 t# h$ G5 ]4 d8 K! k) v/ C/ r        if A_i=A_leave then send to die% N# P- L2 }4 d8 f# I7 x4 y
        else inc A_i by 1
' j- f- i1 |. w5 _, j    end# L7 U: v' p( m& \
end2 H8 l- e4 H$ \) Z& h
/ C. ?4 R- I1 d) [% O
其中的procindex为整形,代表当前process的序号。. ^# d. R0 J# Z6 _0 [( k$ I
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-22 20:16 , Processed in 0.017685 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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