设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13457|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 a0 C5 s0 p* i+ F0 d/ }- _1 C7 l$ h2 x: |2 t  {6 k" O& M' e: Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 ?$ r; o; H- J# z
, ^- E# o" x- v$ F2 x$ c3 {" `begin P_read arriving( s, I8 u+ G# C
    while 1=1 do begin& }6 Y) s0 _) G6 J. d* O' w
        read A_tote from "data.txt" with delimiter "\n"
  A. @, }% R. A% G& g, M        read A_time from "data.txt" with delimiter "\n"% u) ~4 J- b+ A4 x4 ~, b
        read A_leave from "data.txt" with delimiter "\n"
' G4 r1 g; M# j5 F7 D" }/ R8 R4 r4 m        read A_picks from "data.txt" with delimiter "\n"0 X  c! w4 t* W- u" a' H$ Y! C
        set load type to A_tote
# `8 }' F( F/ W1 E6 N* t2 N        if A_tote="tote 1" then set A_induct to 1
* M" E% o3 ^6 |  v+ f" z        else if A_tote="tote 2" then set A_induct to 2! W- k6 b$ y. M9 o' {9 E: T
            else set A_induct to 3    + s; d' k" q" _; U
        set A_i to 0* }  e; V; ~, I4 ?8 X0 C
        clone 1 load to P_induction
  ?: z" V( l9 w5 A1 W        wait for A_time sec
1 Y4 s! {* ]) N; [& t' ]/ U. w8 `    end# a8 X* G* R2 y# g- p3 _* h
end
# Z4 A6 r2 Y8 s, D2 N- G: f$ s: _5 g
* p0 X& {) D* b$ g( y& Ibegin P_induction arriving
0 h) u+ N8 I7 V3 A- C& @    if A_induct=1 then clone 1 load to P_pick1
* X, N+ n8 A" q# U3 Z0 ?" R5 {) j, v( a    else if A_induct=2 then clone 1 load to P_pick2
0 g7 ~) f8 A( k' t        else clone 1 load to P_pick35 ]' E6 B" b' t# R# O- x& P1 u
end' j8 |, |9 h, q/ x" {5 E. B/ h

* E1 P4 F- g: q8 Obegin P_pick1 arriving
: k; Y; G0 S" |    set A_i to 1
' S4 |) k: ?4 e! D    move into Q_induct1# N- B/ i* e/ w, ^" U! n
    move into pickaisle.induct12 j0 T  D/ Q$ B2 u7 R5 X
    while A_i<=30 do begin& _: {; z$ E' u$ q
        travel to pickaisle.con(A_i)
: J; y! r  l5 h! V  e- ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% {; w  z1 r" W# ?! L6 d
        else wait for 10 sec
/ N" _/ g( N. Z) f7 b0 Q" r& Q# X6 ~        if A_i=A_leave then send to die
! `7 X0 N: ?1 Y& Q* E        else inc A_i by 1+ L' W& n0 L: S
    end9 X! g  J0 j$ w7 V5 a
end
; ]. i3 o) e- C8 I9 E; R( }+ Z2 l# q- T: ^/ h8 T8 h. {5 g) K
begin P_pick2 arriving' c2 J5 y7 N  a: x
    set A_i to 11
; v; `  {' c9 R' h. O2 g0 {+ k1 F* y    move into Q_induct2! d+ x  f& u4 G4 H0 b+ F
    move into pickaisle.induct2% ~5 g& A! D0 ?/ b9 Z& g
    while A_i<=30 do begin% ~/ U' \* f, x3 A* G2 G
        travel to pickaisle.con(A_i)
0 x% f& c- r/ c/ d" X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) V* T& P" ?: u( q8 S        else wait for 10 sec. ~/ G0 [6 {% t# ?
        if A_i=A_leave then send to die( Q! ]8 Z) e1 T. Z" X" f
        else inc A_i by 1
0 ]( W" h" H) `    end( r8 B! J& v) u: @- G) f6 \
end( N( g- ^& |3 e! E
4 r) \: O: i8 Z1 p# U
begin P_pick3 arriving' o' y% C9 Y" G3 t. R* u1 w
    set A_i to 21+ h% [* s% z' w7 u7 c1 J
    move into Q_induct35 C# ?1 S9 H0 x$ y; W7 N0 i
    move into pickaisle.induct32 K$ D+ M* z6 i& ?7 h; H
    while A_i<=30 do begin
/ W6 X7 {# N# i+ N, j# z% f        travel to pickaisle.con(A_i)( B  g& X5 [2 X+ t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 v; p7 `2 G+ ?; ^! x$ t6 b
        else wait for 10 sec
4 n, ~6 s8 C5 E0 L" r0 V        if A_i=A_leave then send to die
, ~7 Q, j9 |+ H        else inc A_i by 18 K' W$ d6 H$ Z1 F
    end5 F1 M# ^7 G% k
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是个什么东东?! w+ y0 i) l/ J0 ~8 G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" D. \/ k4 ^! N1 n4 C# P* f: g

6 N( v$ q& R( [+ u' PAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 a! m  |+ g9 V4 s3 }

- X" I& B+ U$ ]* Q, n6 A% i8 I; k另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 h( C7 U7 N* j# |
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;8 P  o# j/ I7 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: ?+ |4 L1 d: a; i. p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ `* P8 t  s) `2 ?& ^; ]4 M# x/ J6 |6 ebegin P_induction arriving
9 p3 a2 X. D* a' e" C    clone 1 load to P_pick(A_induct)
8 b& T0 p7 e/ i* Mend最大的系
' P. \# G: y9 M# J5 f/ |$ w! O2 }1 U6 S: c( s6 y3 I
begin P_pick arriving" ~9 c2 d% J* v& M
    set A_i to procindex * 10 + 17 T) ~& E! N. ?% G. x+ |
    move into Q_induct(procindex)
" z# \6 i9 d( ~% @) s    move into pickaisle.induct(procindex)
: _0 w! _2 s3 w- W    /*check the type of pickaisle.induct(i), for your last problem.*/
, g5 p* M; e' l9 S9 _& L5 Z
$ l5 J+ r0 x1 X* t% ~1 I    while A_i<=30 do begin( I" W5 ]6 _+ ~, r# v  G- m
        travel to pickaisle.con(A_i)+ D8 s( Y: I3 K: A' s$ X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) C! I9 C6 Q) e( v2 _9 ~* R
        else wait for 10 sec
+ j- H) Z3 ]% P0 K        if A_i=A_leave then send to die
3 e) Q# Q$ s' x  F        else inc A_i by 1
2 k. Q" {# d( D) L* j+ t6 r  a    end3 [) A3 p7 S* Y8 b7 O5 E( f3 u
end
. _0 e- }( Z" ~' n6 {5 a# _; L; l8 Y! G# }$ R- \- w# \1 d
其中的procindex为整形,代表当前process的序号。
: h" ]" c2 `/ 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-4-15 20:21 , Processed in 0.015383 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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