设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 6422|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ b& U+ q) A9 O0 L; a
, e. U, ]2 C* r( t8 [- q我的问题是,在每个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中的数值,不知道会不会有什么不妥。( t  e2 U8 q3 s2 c6 f* Z

% T0 [/ K, i7 X- \' Z$ M2 _begin P_read arriving
  ~+ a4 L/ x* g6 Y5 C  b+ C7 h4 r! |    while 1=1 do begin! W6 w0 X+ t7 |  `  M
        read A_tote from "data.txt" with delimiter "\n"
- [8 W6 L% [9 q        read A_time from "data.txt" with delimiter "\n"- \$ U2 R3 P/ W1 A$ @2 E
        read A_leave from "data.txt" with delimiter "\n") l! @, n" m6 k4 f* u
        read A_picks from "data.txt" with delimiter "\n"
% ~1 {0 i! v; ~6 `4 p% U        set load type to A_tote8 y1 e* W( ?$ D' l2 T, e" Z4 G
        if A_tote="tote 1" then set A_induct to 1
6 D7 Y3 {# e$ ?$ Z9 m) M7 m/ f- T        else if A_tote="tote 2" then set A_induct to 2
& B& \- K" o2 M, w            else set A_induct to 3   
5 r1 Z' o& f1 I        set A_i to 0
2 ]8 h0 Y3 j3 e1 t% A/ k% V        clone 1 load to P_induction9 x+ r4 ~/ T7 x0 L8 |- R
        wait for A_time sec
+ D4 E! U* J: \8 J" A" C1 d- f& J    end
( |9 t) f0 R( d+ M8 Rend
2 @2 d6 H) ^. P4 K$ Q2 I  F& R
& }& x7 Q" Z. A' b& z3 Dbegin P_induction arriving
) h7 L9 f4 j7 k    if A_induct=1 then clone 1 load to P_pick18 M# Y- }( J- f
    else if A_induct=2 then clone 1 load to P_pick29 N- m9 F' l9 u5 j$ k* B# L
        else clone 1 load to P_pick3
; a& o' p0 |  H) A, oend, x- v  o% ]$ `0 e

; i0 @* n% _+ Y% [& c3 y# ubegin P_pick1 arriving
/ V0 A: O# ~& c    set A_i to 1
0 w9 {( m0 J% Z5 R; G    move into Q_induct1/ B* u7 Z! a9 E# t" w
    move into pickaisle.induct1: z; f  s1 t/ T7 k$ y! a2 H
    while A_i<=30 do begin" U, p) E0 Y$ L/ R. D. |. q9 q& \
        travel to pickaisle.con(A_i)
4 y# z+ i# i7 K6 o% M0 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# I& T: a& O! b$ e: x* \9 x
        else wait for 10 sec3 t  d1 i- }: P" @& Z+ ^# d
        if A_i=A_leave then send to die
4 {  @& m) E1 r- M* e        else inc A_i by 1
- W& M5 Y# o) f& c* n: E    end
# H% s+ ~+ F: q/ [2 X4 \0 Eend
- k7 C0 y4 H* Q; S7 N5 S
0 n' g7 B- {. W  u2 ~3 h9 gbegin P_pick2 arriving
6 h6 @# P6 ?% a* M1 Z    set A_i to 11
+ f* j* N5 `0 l5 Q7 m. @  _    move into Q_induct2+ w9 J+ P* z. f! g0 @0 k! v
    move into pickaisle.induct2
4 z/ D  p0 i. i6 R    while A_i<=30 do begin
4 l* K" V' s! V6 X) t6 G        travel to pickaisle.con(A_i)
1 N  `- H6 a' q' X0 k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' s  x3 g3 [7 t1 U8 P, Y        else wait for 10 sec
/ F/ r$ s. i0 k$ M        if A_i=A_leave then send to die. G" j: W8 l. H5 o" J( p
        else inc A_i by 1
" ~6 x" {3 w9 M    end& L2 }! C! m% T6 ?4 }+ b) J  D7 L
end
3 a6 L: j. C  V5 U' \4 }9 A) e; w8 I# A/ {4 R$ ]
begin P_pick3 arriving- p- P) ^" N( {- t
    set A_i to 21
. B( _1 K" L) v# {: n4 Z9 U: q    move into Q_induct3
) v0 Q" z+ L1 B6 p    move into pickaisle.induct3
( ^5 w6 `1 J* u) ]    while A_i<=30 do begin+ B# c8 W1 q1 g9 t+ T
        travel to pickaisle.con(A_i)3 W0 g" Y/ l" {5 ]0 V& W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; ?- N. p8 w1 s        else wait for 10 sec
4 @, ^& u7 c1 H2 U, P+ S  O1 q        if A_i=A_leave then send to die! B% G+ f/ Q6 [: P
        else inc A_i by 1, B5 G" q$ L; }+ R2 g; D& Y
    end
  c# K8 y5 G9 J. w+ f4 X$ J" l: |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" `  h! ^4 `7 ]/ Y0 H2 pmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! S& l' e% F8 p4 X3 n
& A- L; Y# g2 UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 L* n: ~& |1 H2 Z+ G' \

! V* M' p/ P9 h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- R' d4 S( g1 Q: p; H1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; {6 x  {' q) I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 ^: }9 M$ Y( o0 N* W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 A4 q4 \4 {7 q6 X; b4 {begin P_induction arriving. o1 P  W$ p+ L! ^
    clone 1 load to P_pick(A_induct)
. t6 r: C% j$ F5 W4 r+ wend最大的系
3 h. e. F5 O! P. t" d( z7 M( }3 @& }7 o
begin P_pick arriving
# f5 ?+ E( |2 t, ]    set A_i to procindex * 10 + 1
9 w7 m% A( s% A- e    move into Q_induct(procindex), {( F  E( ~: F
    move into pickaisle.induct(procindex)
( q1 ~, J! a! n# M' Z1 f4 Q& G    /*check the type of pickaisle.induct(i), for your last problem.*/3 r- O2 X$ f+ G  ]0 V  p% B

5 C  i& @, v2 R. ~7 H    while A_i<=30 do begin
- t: K2 d# A/ R/ E4 j        travel to pickaisle.con(A_i)
8 `1 ^4 u6 b% _- T& C- K8 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, D! N% d; N" m        else wait for 10 sec$ ^! a$ r, }0 `; L- _
        if A_i=A_leave then send to die7 W, O+ O% ]) K) u
        else inc A_i by 1
( |/ I0 Z* W9 K7 l  e6 H6 ]8 O+ `* W    end
  P% j. U) Y) H; uend3 x3 @4 {: e) }7 K& q, E2 U

8 u) r. X  b; u2 Q# k* |0 ~6 {4 }其中的procindex为整形,代表当前process的序号。
# G) L4 ]1 a5 S) H% l# @: i4 Lstation和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, 2024-5-31 03:20 , Processed in 0.013068 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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