设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12888|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 a8 y' C( I' Y! u; X" z  u+ {1 C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。* f) M- y/ o6 K1 ~5 H

- M$ _# J" q) N3 C0 Y- c) f! |; mbegin P_read arriving
# K8 R, W& h8 h" D: E7 [' z; t. p    while 1=1 do begin2 q0 L  j; ]! D$ T' ]) X7 Q
        read A_tote from "data.txt" with delimiter "\n"
. p; R* D+ k- Y2 B        read A_time from "data.txt" with delimiter "\n"
/ R2 g6 F! v( z        read A_leave from "data.txt" with delimiter "\n"9 N) O- r& Y- D/ q- e* j$ [
        read A_picks from "data.txt" with delimiter "\n"
* A" R' ^5 z9 x* a7 \/ r8 b        set load type to A_tote" s* {+ u5 k" T0 v' M# {* u
        if A_tote="tote 1" then set A_induct to 1
% D" E1 t7 n& i* Z6 x9 f        else if A_tote="tote 2" then set A_induct to 2
9 {+ M3 K: g3 V' K# g            else set A_induct to 3   
. q2 g1 W% \0 t" p! p# M& T        set A_i to 0
5 \" x0 x  E0 V' u6 K3 k( ]9 `        clone 1 load to P_induction: ]/ S0 j; Z  R, K
        wait for A_time sec
! G: C# o+ @( t: S    end# z5 N7 c1 J; w; `/ U& _8 b7 O4 S! I
end( n4 k6 _% P. U. F! t
0 Z# s# _8 T9 V. ~( T3 K3 ~( C2 {
begin P_induction arriving
3 [! L0 s) q$ N- b    if A_induct=1 then clone 1 load to P_pick1
# X2 }0 a$ J" \    else if A_induct=2 then clone 1 load to P_pick2
( ^3 K# o2 h6 [        else clone 1 load to P_pick33 X. z3 ^$ E3 R! Z% [0 d
end2 X3 R1 V: ]8 ~, S
, _9 o/ g" C5 b7 A/ {+ b" u
begin P_pick1 arriving
9 @) l$ Q! L# z7 }4 x    set A_i to 1
' i+ g" h- Y% |$ v    move into Q_induct1/ E: f; T/ ?) }- x1 v! i
    move into pickaisle.induct1
1 T5 ^9 H; N+ M1 W- c    while A_i<=30 do begin
! T: i- [/ x/ Y. n* B9 B% ^8 P* g4 B        travel to pickaisle.con(A_i)
* h: k/ w8 H3 ^" t. \+ C' r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S7 u* t& q+ M5 q# a0 d
        else wait for 10 sec" _! Z4 q5 ^5 P4 r; p9 h
        if A_i=A_leave then send to die" z+ F. j7 P# `
        else inc A_i by 1
- K2 l/ M( O1 d. e    end
# G" `: p/ U; {' U" p+ Cend; n6 }3 h$ j" W9 U+ p& @
% T& P3 V/ D- S+ C  u
begin P_pick2 arriving: Q6 Y3 L5 o  v5 X+ ^
    set A_i to 11
  e5 T0 F) J7 U! A3 p: J    move into Q_induct2
# x! h! T  O! Z    move into pickaisle.induct2
. r, P# f* o* T4 o" Z, J    while A_i<=30 do begin
9 \: R: ~8 w" k, `8 a% L1 D        travel to pickaisle.con(A_i)
6 t; t5 h+ U. @) r) w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 o/ ~) n4 f5 B6 T( K! S0 R        else wait for 10 sec. ]6 ]& ~6 ~) I! k. A3 y+ P
        if A_i=A_leave then send to die
( W& X8 R! n6 q1 i        else inc A_i by 17 m* j" g1 ?' e1 D( K* z, E. V" z
    end
& N7 `# y( o- |end
; g  i5 B4 l4 N) ~/ w( o( W& M/ `% _2 X
begin P_pick3 arriving
8 l+ [5 ^4 ?; O4 v- ~    set A_i to 210 Q, E; |% G- h: N7 k
    move into Q_induct3  Y1 W1 I. H' [6 C
    move into pickaisle.induct3) n, Y# w% P) P! d- s9 w. M1 r, s
    while A_i<=30 do begin
% o  r# h, U1 P% W6 A4 t, j0 R$ ~        travel to pickaisle.con(A_i)
9 N$ s: \$ p4 e8 v& F1 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) A) {/ ]7 C5 M# t# o& h9 u& q
        else wait for 10 sec: Y# d; s; U8 G+ q8 Z6 O9 q2 c
        if A_i=A_leave then send to die
; m3 r* w9 Q" u        else inc A_i by 1
+ v; f1 C+ `# R% f. L    end
" @( ?! M+ B1 Q8 ~) tend

最佳答案

查看完整内容

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 P, H6 T1 x4 Y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; s5 W; }- ~0 A5 ?+ q/ \

" h' z. R$ C. ?AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" Y; q  l9 C. L5 g* v9 t

; y# s3 Q, C1 X! T+ `; s+ u- @另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- ~! {* d$ v' a7 ]* G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" i- p7 M8 b2 K' Z+ M9 v- M: L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, K, J5 }+ s2 R, x
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 _+ b: O" }* N" C: z' }! V" ybegin P_induction arriving
) J& l$ k/ a& i  E. L: f; |    clone 1 load to P_pick(A_induct)% R) e2 L1 @$ u8 r& P
end最大的系- [# d% ]- }+ ]( u9 r
6 E4 i! h# `+ M+ r6 P1 k
begin P_pick arriving
. y: N( A5 ]6 U" c    set A_i to procindex * 10 + 1  n$ I3 c5 ^, B! ]0 S1 \
    move into Q_induct(procindex)4 R9 v0 T8 F8 J% b7 n
    move into pickaisle.induct(procindex)
1 K% \: A$ k' v% w2 Z6 q    /*check the type of pickaisle.induct(i), for your last problem.*/
6 S( @8 S, \+ I0 b+ i/ X; e! M1 o/ p# n( [& T! P7 P
    while A_i<=30 do begin
4 Q, N5 |* u: O' j7 g: w        travel to pickaisle.con(A_i)
* j' k7 n: _- D; Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" @3 }' L$ I  i9 T/ ]: w0 Y2 v
        else wait for 10 sec, e0 h/ q" U: _  E2 m/ d6 |
        if A_i=A_leave then send to die' k" \  C  u% D' r6 h1 b6 E
        else inc A_i by 1
% Y( n4 ?5 R" T% N  b0 B    end# F# |% V6 a7 T/ P6 _6 U
end
3 \! [% H! E5 b! L" u6 `( c! F6 ]# O; ^" D
其中的procindex为整形,代表当前process的序号。
* [1 e8 o' p, X5 O# I1 o+ w$ ~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-2-28 11:14 , Processed in 0.016111 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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