设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13985|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) K) O+ y! W+ E- E! m4 a) ^% \+ |& i5 c+ Q  A  d4 B: Q8 Y5 r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* i6 b& ~$ d( _# E' f" K7 Q. x5 T7 B: X; w  b: l
begin P_read arriving; V9 d5 d8 S/ K: }
    while 1=1 do begin; Q" B1 B& Z2 I' F2 T. y* \
        read A_tote from "data.txt" with delimiter "\n"' ?# |7 e* g! o, N& `% @6 e
        read A_time from "data.txt" with delimiter "\n"
! ^2 L# ^" s% x4 w" _$ y        read A_leave from "data.txt" with delimiter "\n"
; G& L/ X$ I0 \4 p, V3 i% h        read A_picks from "data.txt" with delimiter "\n"' l0 \% l8 X& P8 R6 i# h/ s7 q
        set load type to A_tote
# n; ?0 J* D% y2 x' \        if A_tote="tote 1" then set A_induct to 1/ @( _1 N9 h4 f
        else if A_tote="tote 2" then set A_induct to 22 w# w) Q, e$ Z  F  X
            else set A_induct to 3    5 B+ P9 _) r: _% e5 ^
        set A_i to 09 N( v! _$ X) a, a7 D. p) K3 V
        clone 1 load to P_induction
1 C0 W+ f% }  U        wait for A_time sec; @; u7 L' e- J) P5 Z- E$ W  e; l
    end$ }7 f  t9 F7 o3 R* A$ z9 L
end
% k7 d" Y/ _9 e: V, ?8 I+ Z$ ^" V" L$ h8 k3 K
begin P_induction arriving0 M7 e2 v* ^3 r: L: t
    if A_induct=1 then clone 1 load to P_pick1
7 r, l* k& ?6 \) y    else if A_induct=2 then clone 1 load to P_pick2  N1 a* |: m2 F1 J6 e4 s
        else clone 1 load to P_pick30 a9 z8 @7 F6 o) I5 [! O) D
end" Y5 h% o9 H  S: X2 Y
% [4 r0 z' ?  Z8 V; }
begin P_pick1 arriving$ e  T. g$ Q) r# c6 b7 {+ ?
    set A_i to 1
3 G. c( N9 z. k% `9 ?    move into Q_induct1
/ C) C0 I$ V+ K8 r% T) |$ D    move into pickaisle.induct1) j6 ?& l5 x* d# P7 S
    while A_i<=30 do begin' O* @4 s4 X- l, h7 D
        travel to pickaisle.con(A_i)
2 B0 B0 L" U# o: a7 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' y! _; D! U! _# [; `        else wait for 10 sec- O8 [5 h2 M, j0 j; z- _# h1 {
        if A_i=A_leave then send to die) ^( R$ R9 a- h7 `  X3 [2 R
        else inc A_i by 1- F" u* j6 ^) `# Y, K
    end, N5 v1 f2 [" n
end
! H; q! T$ j5 \- W, Z* ]3 N0 e4 S* Q( b* R4 V; S$ |7 N
begin P_pick2 arriving$ f3 @5 Q9 N2 U/ f  L. ]
    set A_i to 11
. f' ^: D7 ]) ^( e( O    move into Q_induct2
7 R# N& [( l6 |% g; z$ a3 G1 h3 l, O8 N    move into pickaisle.induct2' G# Y/ s6 G( e8 n( l- L
    while A_i<=30 do begin
, d6 r$ A& a: |0 ]0 A0 Q        travel to pickaisle.con(A_i)- o: F9 }. O- \$ t: [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! [  `- H/ g. n6 _% K- r2 Z
        else wait for 10 sec1 R' ]9 N& L5 R! l  k7 _
        if A_i=A_leave then send to die/ \. G2 K8 ~: j! c# ]
        else inc A_i by 1
7 P$ T, v7 Y+ s4 G, ]- H- c    end
0 G, \' X/ e' e! ~$ C3 cend# D- c6 D4 q, ~4 x4 [

( h- W' ]4 U+ _+ jbegin P_pick3 arriving
8 [3 i8 o! e* y  g5 c- S    set A_i to 21' i& B, F; H! y) y9 g) e
    move into Q_induct3$ i# |3 j  v5 D9 E
    move into pickaisle.induct31 ?& n+ y4 m! p# D5 p9 r, \) I
    while A_i<=30 do begin
  Q3 a' K6 F4 Z( @# `/ u        travel to pickaisle.con(A_i)
" {1 i0 f  e; |. a8 q( j0 b  s# s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  d" R- r7 x% N% b* Q: }1 F        else wait for 10 sec8 o. w- M. S9 n# e
        if A_i=A_leave then send to die
9 [+ ~2 w2 x, s/ a* \        else inc A_i by 1
+ K" o$ W: }5 u. ~# A3 T$ L4 L    end# c! z$ D1 @  \% c
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是个什么东东?
' @  H; n$ ^& e: Y+ ?; P. m; R7 ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 U8 U/ m4 D7 w3 A3 R1 G3 }* t

- ]: [3 _5 J5 W9 qAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' M6 A' g9 T: F, z+ k) O  z0 s- i, @( a' E) l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: z: X3 D" ~. o3 F" P: T  v& Q9 w6 C
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 m, s1 S5 E" A3 ~
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) S5 l. }! Y5 J1 i5 h8 p
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 |2 [2 C' S2 N% U1 K
begin P_induction arriving0 A0 h! a1 A, p; ~* W) p
    clone 1 load to P_pick(A_induct)3 {. L1 w2 x: J- i2 L% m; J
end最大的系
3 D) z0 P8 p( G) x7 z% }1 A& [8 G; h/ q  t2 [
begin P_pick arriving
+ t& v7 S7 H% b4 H/ s    set A_i to procindex * 10 + 1
0 J! m0 Q* d6 D1 e  T    move into Q_induct(procindex)
% \: |2 ?6 a3 s+ m1 W    move into pickaisle.induct(procindex)0 X& [" W( A. S* `, E
    /*check the type of pickaisle.induct(i), for your last problem.*/
" Y4 g( n/ ?  k# I0 E4 e! n/ i' \1 S  ?9 u
    while A_i<=30 do begin0 G  F5 M$ w: J* T/ G7 W- _0 o
        travel to pickaisle.con(A_i)
' N6 t/ ]6 |! A0 S/ E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% J& ~6 a, ?. g4 ]9 u# ^9 |        else wait for 10 sec
! G. s0 ~' b- @- [& A9 r3 L        if A_i=A_leave then send to die! {) e4 r9 k0 X9 U$ d  B# e& _0 R
        else inc A_i by 1
+ {1 D/ Y& \" T    end
; V. }" ^* ~2 Y$ T) Q9 oend
' W( b7 Q! j$ o) D* u1 A0 W( I
+ s8 j( M8 M* e7 M其中的procindex为整形,代表当前process的序号。
( D% o9 N; S( r- d3 wstation和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 07:37 , Processed in 0.018133 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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