设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14261|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: T/ C5 _5 w* B! k; z* |1 j, z
- H/ d2 s2 o: a; D8 D我的问题是,在每个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中的数值,不知道会不会有什么不妥。% i% U# d  k3 v( J
0 ^; g) |4 M; F
begin P_read arriving
0 c2 n6 \! e6 d: w) p6 t6 q$ h  i    while 1=1 do begin9 w+ V% p# K" k
        read A_tote from "data.txt" with delimiter "\n"1 l( t" i8 B" x, U+ Y
        read A_time from "data.txt" with delimiter "\n"
+ [& w6 l" f( M: t) e9 o- D5 S. {        read A_leave from "data.txt" with delimiter "\n"
: z& D- {8 w% t; T+ E  z        read A_picks from "data.txt" with delimiter "\n"
, q- P' R' {9 m+ k        set load type to A_tote
& Z4 V  ]9 g0 A0 g        if A_tote="tote 1" then set A_induct to 1
  E1 I. g% r( N) O0 g        else if A_tote="tote 2" then set A_induct to 20 @$ h( P: Z3 a; y8 k; D
            else set A_induct to 3    + D5 |, w0 T, d+ s( ~$ T
        set A_i to 00 |) X  P' j# l1 B
        clone 1 load to P_induction  C+ `, i; R8 p( h8 O
        wait for A_time sec( W# I  e7 U$ |' f8 r6 w
    end
$ B9 f) l- t9 E( j3 U( kend. P7 p9 s# E$ E- c2 b8 N  U) j- `

; i# Y1 c( a$ e* u! ]; O% U! Gbegin P_induction arriving
% m& p, }, E6 b# P    if A_induct=1 then clone 1 load to P_pick1+ ?- y' u* F' s( k2 J
    else if A_induct=2 then clone 1 load to P_pick2
' g# _' V% _& M; s/ W2 O        else clone 1 load to P_pick3
; N/ ?  H( b- \( Y! S$ {1 p/ zend. Q( x: Z$ ?& ]
! y! Q1 a( Q% l6 O- {+ Y
begin P_pick1 arriving' J3 |* @& |, }! N# U, p7 T
    set A_i to 1
* Q- a& W/ I0 `, P+ _    move into Q_induct1
) O# b3 R4 ]1 h, ?$ P' E. c    move into pickaisle.induct1+ p5 l, e4 D8 W; g( X. }  w
    while A_i<=30 do begin; y! ?, Q  L) X* s$ u% M, k1 |
        travel to pickaisle.con(A_i)% t1 w3 F7 a4 d) V1 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 {5 I7 U2 `: J" F0 b
        else wait for 10 sec4 `! G$ Q5 m0 J3 }
        if A_i=A_leave then send to die
, Q7 O7 [: f* {: T) x) g  S        else inc A_i by 1
  T9 R/ \9 t3 ~8 E    end/ Y  Z6 R( _2 Y4 c' ~: \
end/ ~& s$ |9 i! `; U. Z# L

1 H9 ~+ P) J; T0 Rbegin P_pick2 arriving
! W/ a5 a- w& L0 Q  w/ @" D+ p    set A_i to 11
. b2 I; U& w% D: |    move into Q_induct20 m9 H4 i9 _+ S  m
    move into pickaisle.induct2/ _4 z& p8 A9 O9 ^1 r
    while A_i<=30 do begin
5 Q/ p  u7 ^3 T0 ^% I% c        travel to pickaisle.con(A_i)7 @% n/ w$ w% I4 f3 j! D
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ f* }7 @7 z* [+ z) ~
        else wait for 10 sec5 S5 J7 n% n( ?0 c! C2 l/ I, X
        if A_i=A_leave then send to die" Z6 R) z  `; K4 ]- h  T  |3 k8 w
        else inc A_i by 1
+ X" Z  k( b9 Z& w" q    end
& H2 k8 z( G" B7 [% fend
/ H, J/ w  `: o
# q- q5 W; T7 D# b) Gbegin P_pick3 arriving
& q/ D" l# X: q( x) z    set A_i to 21
, x. L+ Y8 ^$ f, u( \+ _" w    move into Q_induct3
( z; G& e! F* M! n& y8 d4 R    move into pickaisle.induct3
' [2 C" z2 @6 E- K/ s    while A_i<=30 do begin
: \6 R" i: H4 Q6 ]  ~9 t        travel to pickaisle.con(A_i)
% [% F6 @% \/ I9 ], R% v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% g  M3 w% L, n& r6 w' u        else wait for 10 sec! e. D8 p8 B$ t
        if A_i=A_leave then send to die
- B& d6 S: A  o6 ]9 t; D$ t        else inc A_i by 10 _, |9 t8 w0 N* u
    end
* H, K; d3 ~2 }& ^( eend

最佳答案

查看完整内容

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是个什么东东?+ `. O6 ?( p  c8 e8 _' q) C& p
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
7 [+ a) f( O7 @# Z9 t, ]6 f6 h1 c* m; Z! q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- k! i9 g2 y7 v8 J" q2 n6 w$ j6 W7 I% d) g1 \
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 Z! L/ Z1 y6 ^2 c
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. V1 k9 A; m5 ~- n9 `2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) A2 c$ l8 ?$ b; r( H. P- }+ Z& K3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 q& D% g; {* F5 w& b# F: @( B
begin P_induction arriving0 e( h; b6 X4 R6 u/ @
    clone 1 load to P_pick(A_induct)1 X- l$ H' [6 J$ U# o: ~! b
end最大的系$ B/ v8 c. R, y% ]  [# M; q/ f
+ {  A6 f! C6 f1 b2 t; Y' L
begin P_pick arriving
' Z# ^+ x+ X7 o' N4 d    set A_i to procindex * 10 + 17 j  D# \: F- d& Q' X+ I
    move into Q_induct(procindex)% D3 p3 G" q3 V: R! |
    move into pickaisle.induct(procindex)
1 K3 |7 a& V. [    /*check the type of pickaisle.induct(i), for your last problem.*/
$ Q1 A; ~" C; P; f
- @4 H* W) c( o1 J" ^7 z$ Y6 c    while A_i<=30 do begin
  P) j" x/ H. D4 P* B: o        travel to pickaisle.con(A_i)
2 R# O- D% p/ _3 S4 S7 U/ b7 s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; s( X/ ?: j" w1 E9 a
        else wait for 10 sec
: [. G1 x: n9 o$ G  m) E        if A_i=A_leave then send to die
& \8 H" G7 s$ B) g+ u3 z9 ^        else inc A_i by 13 h, @2 C+ f8 V
    end
+ @: i" y  w8 G* F" iend% K, D; M* b' N5 B0 Z, W
. {& s0 x+ ?7 N" Z( ~. P
其中的procindex为整形,代表当前process的序号。5 q1 N  j( j. }1 G" }
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-26 00:34 , Processed in 0.015131 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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