设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12918|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 T# z; ?8 Y- S' w# \
" @' C" Z+ s( O; t. P' u我的问题是,在每个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中的数值,不知道会不会有什么不妥。* g1 C; e$ u7 x7 ]& B, ~
3 P1 T9 @' T3 j6 n# ?' z& [
begin P_read arriving
8 y" ^2 V& p  a: V8 ~' @    while 1=1 do begin+ n! k) g) n$ |' G9 {; a
        read A_tote from "data.txt" with delimiter "\n"
$ a- H& q) U6 ?& s2 {5 N# t        read A_time from "data.txt" with delimiter "\n"
* R7 @9 C4 m$ z, j% A+ R        read A_leave from "data.txt" with delimiter "\n"0 K; W; ^+ n" [9 t  \
        read A_picks from "data.txt" with delimiter "\n"
; J0 T; M* K, v/ a- Q        set load type to A_tote
" R7 v3 x* R) [2 T( V( J) }% Z        if A_tote="tote 1" then set A_induct to 10 |. N/ B0 n+ {' I
        else if A_tote="tote 2" then set A_induct to 2; S1 A5 B. t2 H6 ?5 Z) o
            else set A_induct to 3   
! W# J- I4 ]4 G. {" ~/ m: i        set A_i to 0' M1 w+ T% ]$ A/ L
        clone 1 load to P_induction0 l* `+ X; @' O  [! a
        wait for A_time sec
+ X9 ]1 q$ I9 W1 H7 l    end5 g9 O  p( a# S1 O
end
4 ^# K. c; I$ L# z: `% y
& u9 X- e& s8 E1 obegin P_induction arriving
) M* j- `. R: g! D" g2 N    if A_induct=1 then clone 1 load to P_pick14 C! y/ V3 o& u. l, c2 t. L- O
    else if A_induct=2 then clone 1 load to P_pick28 Z  N8 E5 s" t9 @' o
        else clone 1 load to P_pick3
2 a/ Z* H- u. i" _$ r: pend
, h$ B) P, Y! |; g* l, U; {9 m' \' O
begin P_pick1 arriving9 D5 V5 G; L1 ?& U' x# r
    set A_i to 1" j6 P: N8 E( ]& l1 ^: q
    move into Q_induct11 s5 |# ]  Y0 A- a
    move into pickaisle.induct1: X/ K& x9 v9 k& ^
    while A_i<=30 do begin' I$ A' W; y" g7 ?1 ]+ y
        travel to pickaisle.con(A_i)
, ]+ e! ]/ b3 V( }: H' |* C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; ]& n; y2 @! O5 o. V, o/ U        else wait for 10 sec
( P9 |2 `& E4 p        if A_i=A_leave then send to die: U/ T  h- Y" i( Q# S7 ^6 b
        else inc A_i by 1
! I/ l+ {! T4 [5 \    end
  H6 J8 x8 R, O& l( U' yend
" r8 l5 K+ ~, U5 P
& f8 G* `$ r0 R8 x9 w4 Xbegin P_pick2 arriving: C$ S5 \2 h. E6 s5 x# O4 c1 l
    set A_i to 11
, `- W) q* I6 r: J. ^    move into Q_induct2
9 f, x' E& m+ c    move into pickaisle.induct25 M/ ~$ l5 r& S; A
    while A_i<=30 do begin! N& d3 {6 _8 c8 G; a* E
        travel to pickaisle.con(A_i)# T8 N" ~) K1 o# a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: d3 r* Q+ f& N* T
        else wait for 10 sec. e. q* r# @5 c! U3 S0 g7 V1 {
        if A_i=A_leave then send to die7 @# [0 j* P" N
        else inc A_i by 1
; y' g& s  d6 n2 E    end
+ @" @- k0 O& y# Y) [end: K7 B* n2 Z" U& D. ]# x# r: Y

- n) r0 Z- N8 n; r% [begin P_pick3 arriving
+ \) _- m: X: e6 M    set A_i to 21/ Z. Q2 J4 [# W& n# G4 |
    move into Q_induct3
0 g: ]. U7 M; S  [% r0 X    move into pickaisle.induct3
4 T( C3 A* t; r8 v* _- k    while A_i<=30 do begin
/ K* C8 ~, [- b        travel to pickaisle.con(A_i)
1 x( ~8 t2 ^1 [* a& f0 g! h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, @  ^9 z4 j7 ]- n* f4 C* r        else wait for 10 sec) D# ^3 n% y3 p5 c& F1 @8 A) Q
        if A_i=A_leave then send to die' A9 o; C; p# `
        else inc A_i by 1. E' [& n& U$ n6 Q% N. N
    end. N1 b: V1 f! ]; j& d
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是个什么东东?  Z, O* ?; P+ [# P$ F5 e; Y/ W
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 d8 {/ n2 O$ j* @
2 F- O' O, r% G6 O, W+ a- b( Y; y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 ]7 `6 G7 m* e/ c1 F, \
8 p; Y# ]. p! Y; c9 v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, u. Y8 r' [4 B) v( c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; R. K7 q0 E3 a) p# T2 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 ]1 F: `/ g' S3 n3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 P- q7 D3 B5 u, u+ nbegin P_induction arriving& J; S3 b# ^) j9 q
    clone 1 load to P_pick(A_induct). @1 I/ a- C6 c8 ?# Q
end最大的系: c3 q- o4 M+ q

, t  |: ~/ q. nbegin P_pick arriving4 B: P9 t) d  ?! w
    set A_i to procindex * 10 + 1
$ Z. w7 I5 @1 G2 ]$ j    move into Q_induct(procindex)
, u6 p' `7 C4 |7 j: H    move into pickaisle.induct(procindex)
& q( f' \6 z4 G8 p& L    /*check the type of pickaisle.induct(i), for your last problem.*// }" g& M3 B1 x6 N/ a3 e

* ^+ W+ s4 ]7 q5 \8 ^7 t2 I    while A_i<=30 do begin
& w# J8 E4 a6 X, U7 c% G3 |        travel to pickaisle.con(A_i)7 v: `  b+ h0 z6 e4 g8 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 c5 `9 F, Z6 I+ q
        else wait for 10 sec
  Q! x9 \! ~- L7 a  X6 V+ h        if A_i=A_leave then send to die0 J$ f4 f2 b% f: K/ M5 h
        else inc A_i by 1
, I. A! h, ^6 n5 w& j' O    end, Y" l- P5 t, D2 f
end
( a% J. j% o% e* ?* }: O) j- P, s! ?( C! T- ^, V2 [
其中的procindex为整形,代表当前process的序号。. Q' q: d0 W/ |( 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-3-2 16:12 , Processed in 0.016402 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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