设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11922|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# ?/ e3 {  d2 v' M5 p; e* f4 c

5 C- T3 k5 w+ H" c. a, O5 B我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ _4 g: F+ l$ F6 Q  j2 l& }

' R: {# {% b8 {3 @- S7 {* Xbegin P_read arriving/ C4 N; V0 k" y) l6 L. H4 X# f
    while 1=1 do begin
$ C) `) S# S, q5 z        read A_tote from "data.txt" with delimiter "\n"
4 Z$ I' M- X, W8 W, e/ T$ K3 R        read A_time from "data.txt" with delimiter "\n"
/ r- V' C( x- G" L  a1 e        read A_leave from "data.txt" with delimiter "\n"/ W4 d6 g# k5 @
        read A_picks from "data.txt" with delimiter "\n"4 i. i2 l4 v  ]8 Z6 a1 \& m( n
        set load type to A_tote
2 s1 G: T. h! F% }        if A_tote="tote 1" then set A_induct to 1; A  g* Y$ I9 z, g4 v: P3 `
        else if A_tote="tote 2" then set A_induct to 29 @  U7 t7 y' T) H5 y
            else set A_induct to 3    2 u9 N7 R$ G+ ^2 c. Q
        set A_i to 0
/ X2 e1 c- c. \5 Y' C        clone 1 load to P_induction1 w, K$ X% K1 r' _, }
        wait for A_time sec; f; `8 h" Q$ s7 e! Z, Q
    end
. g" v& G# y/ a! S/ }end
( ?( t% G8 F% j8 ?% Q
. _+ C2 t( x/ G0 M' c+ abegin P_induction arriving
9 V+ r* t+ l& j/ q  {    if A_induct=1 then clone 1 load to P_pick1! \5 a; `: e9 f
    else if A_induct=2 then clone 1 load to P_pick2/ [$ {$ d3 j) C4 n  W' r
        else clone 1 load to P_pick3
. H0 o- Q. R8 q. ~& cend! H% t# p2 ?, e

; l2 F3 m4 n* |, E( b4 W4 hbegin P_pick1 arriving# k5 Y2 f$ A7 z9 U. A
    set A_i to 1
$ M' o9 i; g$ I; b/ U    move into Q_induct1
( S+ C& }: u; ]/ E, G    move into pickaisle.induct12 s, }. g0 g3 n" M- i" a' ?
    while A_i<=30 do begin( d- D5 Q( B4 {7 i
        travel to pickaisle.con(A_i)
7 U1 }6 I* Q$ Y3 n" B9 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ @0 t3 a! ~5 ]# ^# A3 ]9 z
        else wait for 10 sec
, N5 K, O3 @# x/ C  `- R        if A_i=A_leave then send to die/ ]7 A7 @% i/ d) S- W) c* a
        else inc A_i by 14 A% f8 R* M1 @6 Q
    end# Q# c, `% ?+ E2 [: M
end
: ^0 U+ Y3 e, ~! |- L( x8 }
1 j% b9 ]6 W$ t  c( W7 dbegin P_pick2 arriving
4 n" p# l; V2 ~* F4 s: h    set A_i to 11
$ B  f: q0 I- ^5 t1 M& R    move into Q_induct2
: r; M$ P: O- c" l  u    move into pickaisle.induct2* v6 v$ P5 s$ c7 A# |- z) {
    while A_i<=30 do begin
$ ]0 O/ D+ }% k5 J        travel to pickaisle.con(A_i)
4 ]% d4 Q* h- S# I+ Y4 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! f2 @- T+ V; g6 v1 k        else wait for 10 sec. W% J8 k, J# X* m1 s; U
        if A_i=A_leave then send to die  |) B1 c8 M) ^# S% I2 y5 J" X
        else inc A_i by 12 a3 Y! `" B9 e4 u% i% C
    end; E" [  C! W+ ?. [  v; G3 V
end
$ \. n/ d: Q) `5 _" [  M; U; I
# F' @0 }$ ?6 B! v) j2 J- `begin P_pick3 arriving! b, W5 q: H6 K3 V# [3 i
    set A_i to 21( w. X0 s' A" w% q( ~$ M% _
    move into Q_induct3
+ ?1 l% c! V7 u5 Y$ j. k" P    move into pickaisle.induct3
( {5 D  L# c9 w" K0 I; Q    while A_i<=30 do begin
; |5 y$ G; N' T+ R( c! X1 q$ w6 u        travel to pickaisle.con(A_i)' K/ V( i- }/ N4 K' T8 Z  V; |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# r$ c$ B+ H, }" p3 M* W, L: L
        else wait for 10 sec
& c9 a1 f1 E  S- Z        if A_i=A_leave then send to die
; `0 Z3 |6 Y- a. o& K8 q        else inc A_i by 1# }5 b  R+ D0 t! f2 A) i$ i
    end" Z, Z( D" d5 G. ]4 |
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是个什么东东?9 |9 k2 k  W# e: `+ B( n, L$ A' z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 ^9 H8 l: [: f+ H) G9 v
8 k/ c, O3 G( Z8 i- O7 e3 mAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 J4 d, t9 O: ^4 H+ t. [
2 H: g$ _* a( p( E& a* }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 Q' L* t/ H9 N0 M9 E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;9 u% \0 u$ X8 H5 a- O# s1 b
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- J6 C8 E2 Z# C$ x4 I1 m3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) d+ g9 O0 G% R, e) O5 ]
begin P_induction arriving4 r5 F. j5 n1 e$ c# g( [! O7 a/ n
    clone 1 load to P_pick(A_induct)
, f' m& I( i: w! a1 A( kend最大的系
, P1 i+ P1 R: Q9 w/ u! P" g7 B/ {5 Q+ L" y* _- L1 d, M- c/ t; o
begin P_pick arriving
) s% u- M! g5 \" H( @' O    set A_i to procindex * 10 + 1
6 b" U% r8 D4 o3 {( t8 C    move into Q_induct(procindex)
. k) m* c- E. s6 {    move into pickaisle.induct(procindex)0 E, W/ o: L6 G# {- ~& q. [  K
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 h! H! I& X) s7 B) t, c
: q4 e3 x8 ?( {2 _. S1 r8 X  v5 n    while A_i<=30 do begin0 e& z2 Z  E! O( u
        travel to pickaisle.con(A_i)+ c" p# E% b" {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 `, s: [6 w* V9 Q- T; M! m$ w        else wait for 10 sec( s; C& m# y" I; Q3 @( J
        if A_i=A_leave then send to die& Z# _0 \, {$ U" J9 x( z; [
        else inc A_i by 1, P- q+ [  d) w3 B9 U- j7 t4 ^
    end
) I2 ~, }0 H  j: w9 oend: s7 A  i9 t- D) y" e8 g
/ U9 c* F+ n7 k7 ]8 j
其中的procindex为整形,代表当前process的序号。8 q$ R- c) B" I' {' f1 P- J
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-12-15 16:10 , Processed in 0.021474 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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