设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13952|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& B$ v8 e, }6 G9 Y
$ {; R3 p6 X5 ?* e3 `
我的问题是,在每个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 v1 \5 I: L1 O- C2 R

- Q' A# K' i2 a  ~6 ^9 Z7 Wbegin P_read arriving7 }2 G# [$ V( h+ {
    while 1=1 do begin
0 }4 D4 s& [7 d7 l4 X, i+ c& J        read A_tote from "data.txt" with delimiter "\n". v1 s, L( ?7 [  T' U5 a
        read A_time from "data.txt" with delimiter "\n"
* E- y5 H) P* r1 c        read A_leave from "data.txt" with delimiter "\n"
& C1 v$ c& m: M4 c+ X8 X1 V1 R        read A_picks from "data.txt" with delimiter "\n"/ w4 [" r" b2 H
        set load type to A_tote9 T: L( c5 @3 d) B6 V/ g" C
        if A_tote="tote 1" then set A_induct to 1. H9 e6 g; Y- ^+ {
        else if A_tote="tote 2" then set A_induct to 2% t$ n! M; o( t6 Q4 \/ ]. [
            else set A_induct to 3   
% n3 H, |- [$ V& B7 U7 Y) u        set A_i to 0
' U0 R' Y- w: B: q        clone 1 load to P_induction
) {5 Q) J1 N/ z$ C& |        wait for A_time sec
, ]9 h7 y' g0 M/ e    end8 P2 {2 d7 P0 ~1 ]$ I! V
end* \1 Y+ H* O6 e

' S# p" C7 o( s+ Ebegin P_induction arriving
5 s3 O; Y" L2 F5 H& W( o. T    if A_induct=1 then clone 1 load to P_pick1& _& k7 J) [+ X5 I" q6 @0 [
    else if A_induct=2 then clone 1 load to P_pick2
; s: r4 C! L, g% S0 r6 k" F. \( K7 U        else clone 1 load to P_pick3
& a; h' Z* g: {4 h$ l+ rend
4 X" s- E  ]: t. Y" g1 Y, o' W# Z. d
begin P_pick1 arriving. v& |: F- M& K6 K# B
    set A_i to 1
+ l* b' R, z; U+ n' o    move into Q_induct1
% Q5 L( i/ E( h+ b' c    move into pickaisle.induct1
  A2 g$ ~) T* ~2 P    while A_i<=30 do begin
# U9 Y; H1 a, Y* \, q# D" c) N        travel to pickaisle.con(A_i)4 B; W7 H( ^4 P3 H+ r, d* I% n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- y- X! C* d. ?# D1 M        else wait for 10 sec
9 p! S9 E7 [" p( G        if A_i=A_leave then send to die% G1 w4 H) B( \2 b: w
        else inc A_i by 16 z: ]3 j1 ~0 L) q/ n# i2 p; a
    end/ Z, O; D% H4 t! T$ ]
end# n7 Y: s' A4 e; h9 p% Q
+ k# j5 R! v9 M" M) E# J
begin P_pick2 arriving
8 u; S4 [9 m1 D8 P% {3 ~! X    set A_i to 11
! g/ w8 t( ^8 c    move into Q_induct2$ U( ~1 L  V+ n0 s2 C0 `# r
    move into pickaisle.induct2
9 c1 z9 \( P, r) P    while A_i<=30 do begin( d) m$ D' ~* p$ M. O% w& Y* V" E
        travel to pickaisle.con(A_i)
4 }  |: c2 V6 q3 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 U* F$ o9 T/ O: g0 s6 {        else wait for 10 sec
3 ?4 G6 z- B( [6 V$ ?' w        if A_i=A_leave then send to die, j# \9 H3 O+ Z# q. E
        else inc A_i by 1" ~# p' m" R3 Y2 D
    end
  {! l+ D9 x9 l$ bend
" ^. C( r* O* }/ ^
7 m% K# `  J0 h& ~2 C7 bbegin P_pick3 arriving, S: E6 [6 N! ~# P& ]$ H
    set A_i to 216 R4 y# ^. O3 a" a
    move into Q_induct3
  S5 f7 S1 {" }9 I! U    move into pickaisle.induct32 n7 b1 ^- s6 Y( ]9 ?/ ^( w' ]
    while A_i<=30 do begin
: `7 G5 Y* N; ^( Y        travel to pickaisle.con(A_i)
3 @- K# i( x* I  y% B) s( C6 E# J/ w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 `/ w- w6 s/ ?0 U) ]* J& {9 `
        else wait for 10 sec
. @; _. k4 h2 n+ e; h        if A_i=A_leave then send to die( d2 ?6 I! U  _6 a/ s% c
        else inc A_i by 1! p1 U4 b7 f$ ^4 c+ @" z* x2 Q
    end
* y8 y5 j9 w" b" p# H0 T( aend

最佳答案

查看完整内容

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* Q+ J  ^% H1 B0 Y7 tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 R4 _$ P" x& M( p5 t/ i

# F% ]& y# C1 h! x' I# l5 wAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 }' V& N  n0 ?. M% E7 Y; {

3 h1 B2 ?' ^/ J/ }6 Y$ K. o) w5 }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: H$ n' X. z7 Y4 t6 g1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 a" R7 W/ k' A: l  X9 u  m2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 C" M+ ~4 G( ]0 m' [9 x+ W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) Y- C) i6 r) ~6 jbegin P_induction arriving: a( M9 q: D. h" x3 `2 `* V
    clone 1 load to P_pick(A_induct)* w5 o6 b* K1 v" X: m9 A5 V9 Q9 G6 y
end最大的系
- m; x# g$ O; D
+ v1 ~/ L# N+ f$ Q  N) @% {+ `1 X- J# jbegin P_pick arriving
( Y: D! S; ^4 E* f2 t. {5 y    set A_i to procindex * 10 + 10 @- D/ s/ N0 d% m" ^! U' o
    move into Q_induct(procindex)
: S8 i! p8 |/ w" E    move into pickaisle.induct(procindex)
' L0 n) q' |/ Z6 w+ J# z    /*check the type of pickaisle.induct(i), for your last problem.*/
) k- J- V& D$ b1 m5 T& G# V9 F+ c5 Y8 B' g1 b0 q, j$ H) }
    while A_i<=30 do begin; b4 U+ b+ m# @4 F6 c
        travel to pickaisle.con(A_i)# C9 e# p' ^* @* F1 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( h' x) o' j" j- S7 I8 X        else wait for 10 sec. b2 b( A, ]5 y' a/ J8 k; F
        if A_i=A_leave then send to die
- J1 f* Z# ^' C3 [        else inc A_i by 1
  ~3 W7 [) @/ J+ [* }0 [    end
$ k) T# I' F- Oend
. f5 b& I# ^" k& w: k; p' f  V: n, W0 W3 N+ X6 Y
其中的procindex为整形,代表当前process的序号。
7 ^, U9 O3 S) m4 C* j, O; C' Cstation和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-23 20:33 , Processed in 0.017478 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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