设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10459|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 A$ i2 d7 s5 g6 m
5 s  g6 F+ x& I" v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 K" j; ?5 c( C9 m  u0 x
6 W7 K' V! @$ d! r
begin P_read arriving
# _1 O9 b+ i, }& o3 Q    while 1=1 do begin
# y# W0 e4 t$ b! `' O        read A_tote from "data.txt" with delimiter "\n"
  m$ Q/ v7 P* g6 C        read A_time from "data.txt" with delimiter "\n"
2 b4 H. B* P% p- c) E        read A_leave from "data.txt" with delimiter "\n"
# f0 t- u0 M6 G4 j  }7 \6 a        read A_picks from "data.txt" with delimiter "\n"
1 r* q% s4 P% ]- m# Z2 I" d        set load type to A_tote
1 S3 A3 N9 w! `" o8 T9 G/ o) W        if A_tote="tote 1" then set A_induct to 15 z% ~5 j" Z, A% Q9 S
        else if A_tote="tote 2" then set A_induct to 2
" [0 C- ^0 t$ g% N8 W            else set A_induct to 3   
# M( C: p0 z# f( a% K% c" J        set A_i to 07 V; G: }* s/ t: D
        clone 1 load to P_induction
* j$ b& N  y" i' G% L        wait for A_time sec9 {0 u; s" |0 M$ {
    end
% f+ g" t+ j3 }, k! pend; I+ d1 ^4 K$ C' }

1 i" T% ?1 E$ @! jbegin P_induction arriving: a. P/ z- e+ E0 P
    if A_induct=1 then clone 1 load to P_pick1, R8 {3 e, a( g& W  T: Y, k
    else if A_induct=2 then clone 1 load to P_pick2
2 R/ B% G; Z8 ^' x2 }% f        else clone 1 load to P_pick3( p" }3 a; B: V" P( h9 q
end0 I* H2 F; [- b  t" D* }3 ^+ |
6 ^; s  L4 r, r; e+ N) p0 R" P9 |
begin P_pick1 arriving
! Z9 M! [2 _8 ~5 J( P    set A_i to 1' U) d: X8 ^7 l  u9 X
    move into Q_induct1
  g6 f* f2 S+ m% S    move into pickaisle.induct1
% z1 B' ~, H6 i2 O    while A_i<=30 do begin
6 H" H  I- L- F& M3 b( m* o  y        travel to pickaisle.con(A_i)5 s& [+ t7 _; N$ M, M' P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- f) B) R9 B# G
        else wait for 10 sec1 ~7 b6 o  [5 z! [. T9 x' T
        if A_i=A_leave then send to die
2 A5 ]0 m5 @% u9 F6 H2 A# a        else inc A_i by 1! L& g% Y, z# c1 a  J9 o  b6 {% w
    end. n' }8 N' F7 V7 A% Q4 _# o
end
3 f0 m8 d& R) l2 h8 V
: r9 U$ k+ ~, ]3 B' T2 F/ ]8 \begin P_pick2 arriving
0 `. U5 M3 v& n1 ^% e: U    set A_i to 11
" A3 U; W& x$ g# g! F    move into Q_induct2* @1 y+ k7 N% U+ T2 e
    move into pickaisle.induct2! N5 g! W2 o1 v+ @- B
    while A_i<=30 do begin
9 l# m- L3 Z* N- Y2 R        travel to pickaisle.con(A_i)3 m% S$ R1 o* A/ H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* J9 r5 b( `5 q5 a5 z% f4 u' P* A' P
        else wait for 10 sec" [& D* [& I+ L2 M$ U
        if A_i=A_leave then send to die( X- N% \+ c" s1 l7 @( y
        else inc A_i by 14 k# q8 J7 J" @* S" [& c* l0 |
    end
: L2 v2 \; J+ l1 \5 @+ y, D; Qend3 R- _8 x9 b% q2 u0 x1 v

4 w. A$ R. g  }/ j% u9 r& w  rbegin P_pick3 arriving
  k6 w. N  g# w$ P) a    set A_i to 210 h& E5 z/ t, D0 u
    move into Q_induct3
* }2 J+ S+ L# p; y6 W    move into pickaisle.induct3
' t& z! [3 e) A8 e/ g! O. K, [    while A_i<=30 do begin/ u- L8 V# d/ p6 R
        travel to pickaisle.con(A_i)! b! U5 L2 q+ S" r8 g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" M! S' `5 z4 v+ t6 N
        else wait for 10 sec( n" ^  p" h' G( O7 e7 L
        if A_i=A_leave then send to die
% D7 g% R$ V# R' R& ?) A8 |0 s2 r        else inc A_i by 1& A* }. Z7 |6 v8 \4 C
    end1 G7 c7 |) Y5 \* A. i8 E1 x
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是个什么东东?2 b- J0 Q% Q# b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 b7 Z+ l8 Y6 h' E' I( \
* }+ F1 i  S, f5 `/ {) f* O5 z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ b5 H! ~2 F" ~1 @6 |

. j# W# f3 u1 A% M, J/ F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 K2 y  ~+ f. B+ a8 g
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
7 q2 n& `- s; x2 f& d2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! }& S/ r: k( h5 ?% n/ b3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, m2 q* Q6 T% W9 M9 Q7 ibegin P_induction arriving; S; a1 T+ A- P3 ~1 C* k8 I, h
    clone 1 load to P_pick(A_induct)
9 M" l; q9 t1 ]: N; }5 {end最大的系" _) {0 P4 z  I8 k5 _" A
! L/ R/ o3 t" M) E1 e3 d4 q
begin P_pick arriving5 F# e! w7 m. a4 Y& ^& t  ?) _  f, a( r
    set A_i to procindex * 10 + 1
& k9 C9 k" o5 n6 V+ R    move into Q_induct(procindex)5 A7 Q# {% @  @) a
    move into pickaisle.induct(procindex)6 b' T' K3 H1 f8 Z6 e" |! v+ U2 d
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 N- b* ]  _; ]4 U% i: T. f8 z! ?! }8 j9 ?- P1 C
    while A_i<=30 do begin# K2 h* b! M8 o2 P: w
        travel to pickaisle.con(A_i)" t; o, u. @; m- @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 C; Q) A8 e& ?  w        else wait for 10 sec5 F% x: E& N9 H5 q: U* i3 H8 u8 H" |
        if A_i=A_leave then send to die; A# @# q  [2 v. e! C( |4 v
        else inc A_i by 1
0 L& @, F4 F$ v$ u    end
5 c( ]" f2 _' N$ y& g# }. uend3 r' i0 W* w' a% `! N

5 q$ C$ G3 N. L- j' _. e$ I$ X" d其中的procindex为整形,代表当前process的序号。: x7 ^% y" `' n! k) O* \
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, 2025-9-3 09:50 , Processed in 0.013066 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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