设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14218|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: ?4 }6 A5 U( f, c. n5 G7 h
* d1 k8 I6 j% f4 X+ y4 P我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 n" T; L6 j5 b, s" G% j& i

2 R4 L' d7 f6 O' e) w  jbegin P_read arriving
, l) _; P; D, @. Y) n5 a    while 1=1 do begin
4 x  Q! s+ P9 v$ _" \& G0 r        read A_tote from "data.txt" with delimiter "\n"
1 G1 o& _0 o5 p4 G& z        read A_time from "data.txt" with delimiter "\n"* k* t0 r! h  S1 {6 H
        read A_leave from "data.txt" with delimiter "\n"
: @3 b% v) a& h0 ~; c        read A_picks from "data.txt" with delimiter "\n"  \9 \  |1 b" o8 h
        set load type to A_tote) G% @$ X# `, E6 ?
        if A_tote="tote 1" then set A_induct to 1; K# A/ `; K+ p1 d
        else if A_tote="tote 2" then set A_induct to 2  g4 l  @& Z' u& b9 ]
            else set A_induct to 3    4 k" S9 L5 s+ |$ o
        set A_i to 0; u# C  h2 b, L7 B0 [, P
        clone 1 load to P_induction
0 X( }- u1 v" u6 P* U7 X& ~& i! k+ f1 l        wait for A_time sec6 `5 F) r' E2 Y9 k. a
    end: k( k; {8 t% |
end) T( t7 v& |4 {5 m% S) ~. H; l9 M: K
' [6 Z! A- @2 H9 `+ N4 d) \6 d% G
begin P_induction arriving8 ^% Y$ q9 e- _6 k% H6 b  Z
    if A_induct=1 then clone 1 load to P_pick1
4 f+ d! y) H5 _  h! o3 I! E    else if A_induct=2 then clone 1 load to P_pick2
2 W8 T& y6 a6 L& |; ^        else clone 1 load to P_pick3
' ]3 |, ~1 l  r0 L3 i5 Gend  B8 y% M" c: D

* g  q/ G1 b; |; Cbegin P_pick1 arriving  Y- j# P" y) Q+ ~* ]
    set A_i to 1
, l& `3 I8 t, y    move into Q_induct1& k" t8 `* y1 o. x: M3 n! A* ~
    move into pickaisle.induct1
- m( d9 o( v. S: U1 F7 O: Z    while A_i<=30 do begin
  ]! Z8 A9 R* h5 I7 h9 b  ^3 D        travel to pickaisle.con(A_i)
' s% O' |- g  Z, D! K# y1 U% U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ b7 q1 g. L7 I
        else wait for 10 sec
# e% H4 G/ {% f9 W( K4 |: P        if A_i=A_leave then send to die2 f  J: j7 G4 q. k- F6 N) F# O4 o
        else inc A_i by 1/ V0 l* e3 c2 B" M. h/ E2 q8 f0 g; K+ ]
    end
; f4 Y+ r. @: |9 |% \& h! pend
3 F  [* _0 N0 W8 y* v$ z4 t# ]
* R6 G. Q4 T: L/ V3 f1 ^5 qbegin P_pick2 arriving1 f" q  k9 W7 [9 Z" B
    set A_i to 11
* ]# }; s0 t$ K  Z* S% {6 T    move into Q_induct2
# N- w; _1 S/ H) X. w( \7 }3 c1 O" _" M    move into pickaisle.induct2
: J, B& h$ B9 X2 }8 X% W: f    while A_i<=30 do begin/ V. }" P; S  J/ R1 J9 z% m& T
        travel to pickaisle.con(A_i): p- r& `' u7 n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d/ _- f, [7 V8 L
        else wait for 10 sec
/ |  ~% _# P( f% G" s1 Y- h; W        if A_i=A_leave then send to die$ T; O0 p& @9 A' R
        else inc A_i by 1, }) Q" w3 F9 \; E2 y# V# B
    end
2 W( \0 c7 |& X& A4 j) f+ ^$ L5 Pend& A8 z) r6 g" ^( k5 u, w

- N. i3 H5 i/ F% b( Nbegin P_pick3 arriving4 V) C% A7 Q0 _2 J# c- y8 M2 A
    set A_i to 21$ ~& C+ U9 U, b
    move into Q_induct30 G( a& d, ~! v
    move into pickaisle.induct3
1 [: z: B9 ^" r& J# D    while A_i<=30 do begin, u- w# p& |- F! S
        travel to pickaisle.con(A_i)" C/ Z1 ?  f: M$ G- T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G/ D1 y2 c1 a, I* ?) e        else wait for 10 sec
; g; }+ e- c) o7 K5 b        if A_i=A_leave then send to die
( X3 g  V8 R" U" E        else inc A_i by 1; b* X( a( u9 F" [. u
    end
' Q' C) x4 c& N2 Cend

最佳答案

查看完整内容

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 v" {8 t, K1 D$ e$ U# |+ I
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ {, T- J9 [% u2 c3 n& E3 g' b+ L
* e" T0 ~' J9 y/ NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 a- S7 L6 x9 k  ~1 K& V

* T  Q+ @. K- F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) U6 X, Y2 c3 ~
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 s, z# ^+ [# X& n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. p0 O7 x9 ]; q( n0 k5 d; v
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ U/ h2 V4 h5 v# e3 L& ]) k3 n4 n) U
begin P_induction arriving
3 c4 N- p+ Y9 J8 n' l/ G$ ]1 U    clone 1 load to P_pick(A_induct)) E& h+ e1 u) ]- R% A" ^$ ?
end最大的系4 I, ~3 ]. J+ G

& f# M" a1 {$ h; Y. Y3 X5 ubegin P_pick arriving6 D0 L9 e) |! g, n: m$ j
    set A_i to procindex * 10 + 1
, Q* |# ~8 D. s1 v7 d6 y* J/ ~/ \+ W, V    move into Q_induct(procindex)
$ l7 @; ~4 U6 n& v2 k    move into pickaisle.induct(procindex)# S; d. b8 `0 y% o2 E
    /*check the type of pickaisle.induct(i), for your last problem.*/
- l$ O  G. p+ @* e+ d
9 Z6 U) B4 {4 I3 y9 \; i4 F8 H    while A_i<=30 do begin& C6 U9 U3 M' y8 m8 t" o5 D' V
        travel to pickaisle.con(A_i); w$ I* I+ L" Z5 f7 E! V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 }/ F- Y0 \1 n0 O0 y
        else wait for 10 sec
4 f( [; ^7 e& x( J, ?& @        if A_i=A_leave then send to die
! j- D/ V! M5 o2 m* G" Z" D+ _1 U        else inc A_i by 1
6 w; t/ l# l7 C    end
7 b) C# p3 j2 k3 cend
- |  `( ^8 X. @+ S. {4 F" R! Q+ X* E4 B, p- G+ `; k
其中的procindex为整形,代表当前process的序号。; d/ t. i* U5 F- b4 K, D) [, x
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-6-22 08:05 , Processed in 0.040411 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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