设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15511|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ a1 \6 }( O( v% S
2 k& }5 X* y- I5 t" F3 |/ n我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 c0 N2 G$ E5 N9 [- y$ W9 t$ H
9 \9 @/ a, ~2 u* v8 Nbegin P_read arriving
$ \. R9 O5 H% m3 v2 y    while 1=1 do begin
0 v3 Y2 T6 ^% b8 |5 P        read A_tote from "data.txt" with delimiter "\n"- R- B: G; Z3 L3 S
        read A_time from "data.txt" with delimiter "\n"
" N0 U+ [! [7 y3 Z) y, T7 F        read A_leave from "data.txt" with delimiter "\n"
; _) S5 d/ \$ k: S( G6 [        read A_picks from "data.txt" with delimiter "\n"
; K; A5 ^& f0 J0 \4 N, E        set load type to A_tote) w# P' m; O, Q$ V; ]
        if A_tote="tote 1" then set A_induct to 1
: u2 q4 z/ |3 g7 t, l        else if A_tote="tote 2" then set A_induct to 2$ f; S  U- j: T: P
            else set A_induct to 3    % ^& S' c( S6 t2 s$ }) ]
        set A_i to 01 k. B& S1 q, \$ F/ ~6 C8 U" P
        clone 1 load to P_induction2 B) e  B, r7 }$ F% y
        wait for A_time sec
, j6 K  B0 b1 |6 i6 S2 K3 D) s- \/ x    end0 z* K0 B* A9 q& m1 a  S
end4 ^. e; h9 m# M) R3 Z) ~

- M6 E) U6 E4 S- Z# sbegin P_induction arriving! a  q* W# k: [2 x5 j' d
    if A_induct=1 then clone 1 load to P_pick1
5 H" O! P4 ]( |# R. j! u+ Y    else if A_induct=2 then clone 1 load to P_pick2
* W1 H* t* h+ H* m: Z" I% I        else clone 1 load to P_pick3( C5 u) e; k+ g
end
+ W2 w% s2 R- P% Z  g9 j) u8 t# W2 w  }( B
begin P_pick1 arriving
( ?8 ~8 I! `. u1 m0 V    set A_i to 1
. F0 e+ v4 N, S- n. l    move into Q_induct1, N) ]/ z# Q# ?( G/ Z+ P
    move into pickaisle.induct11 B- Q( v/ I. M: y4 I
    while A_i<=30 do begin
' m5 [, U/ w$ S! I+ h% u* Y        travel to pickaisle.con(A_i)
+ `! u( W1 H$ X3 K+ q# |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 X, ]( {. \" H1 o1 h
        else wait for 10 sec
, n# w( g4 u3 d9 ^        if A_i=A_leave then send to die
! \1 _# _& I1 t1 m5 s        else inc A_i by 1
( T  Y. I2 }% R; Q/ W* d; m% s2 c, z    end/ Y1 w) G  z2 |
end0 f( |' G; B0 v- i& ~

" F. L: J% \! V. p$ x( f$ h9 ?/ i* bbegin P_pick2 arriving0 O6 |, v  _5 Q- o
    set A_i to 117 x9 X* h4 V; w9 V" S6 R# O5 w2 [
    move into Q_induct2
1 Q& {1 O' o, V% |* E" z    move into pickaisle.induct2
# ?9 \, G, {6 {    while A_i<=30 do begin
7 [, |' T5 x% R% R& n        travel to pickaisle.con(A_i)
6 O. {9 {; a# _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 d  e0 Y2 q, R- w% Z# J        else wait for 10 sec
! P& ], v6 m1 g* u8 L        if A_i=A_leave then send to die  Z* Z  a0 B% s& d* o% ^  P, |# o
        else inc A_i by 1
; w: w/ ]+ l: @/ Q& D    end
0 e  m/ f4 w' nend
+ d% b7 k  E' E" A! h
1 d: x  g1 \. I& P) zbegin P_pick3 arriving
6 ], J' ]: h5 J7 D+ i: U    set A_i to 21
6 S7 _# q# L$ C: @+ J# m8 ~4 h    move into Q_induct3/ [# S6 b5 X7 S$ a: q( j+ }; U
    move into pickaisle.induct3
; ?2 [9 o) t& |/ s( w- y    while A_i<=30 do begin$ ?" u. r8 R$ M2 o
        travel to pickaisle.con(A_i)
: F0 G: z- u- x  }5 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ x  e0 r: a# L# O1 l
        else wait for 10 sec
$ h5 B/ P6 Q% O( Y) ?; ~        if A_i=A_leave then send to die
: l) S& G9 @3 }3 S0 h        else inc A_i by 1
3 q* @0 v# z( ^8 {3 j* n' E    end7 r8 ~! O* W1 X6 n
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是个什么东东?' h5 q( l+ `' h2 t4 C# F
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ \+ @' q5 Y' T
& n/ T6 v. k2 H& h/ g  A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; V+ k2 Z3 q2 k! z- J$ v; t- Q3 h) _2 F6 [% x- a, C. g
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ F. a2 L- _4 ^2 |. X
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ w/ d7 ^! G% U7 G" p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 B  l4 v, k/ J3 ]+ t- a5 [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 q8 g3 G3 B6 N0 L
begin P_induction arriving
6 d5 K' A" [% b7 J, `    clone 1 load to P_pick(A_induct)* N1 P# H& B* W% Q3 D/ l' U
end最大的系0 Y- P0 G% v2 F$ ]
( e8 O4 M7 F# b) @; x/ r
begin P_pick arriving
8 ]1 s2 m0 o' ]. {6 c    set A_i to procindex * 10 + 1
/ W  ~; e; z4 W, Y4 W    move into Q_induct(procindex)* c' u3 f4 g+ h4 g( A8 a) `' {# n
    move into pickaisle.induct(procindex)
; z$ S- r: e- t/ u' c6 M& G8 v# _( _- ~    /*check the type of pickaisle.induct(i), for your last problem.*/0 x* A- r! @3 O' h2 v" S

8 ]. Z! A; }" ^( N  |    while A_i<=30 do begin+ Q% K# Z& A- y& m6 y
        travel to pickaisle.con(A_i), v" M# [8 t' u1 e) t1 Q( F! d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- `8 L. K2 x( _* G8 O. m, C        else wait for 10 sec
. G6 \, E8 z0 u2 ?5 w        if A_i=A_leave then send to die
% j# S: ~/ d5 x) |        else inc A_i by 1
+ Q+ G% q/ N$ k. {. Z% w    end
. j% l$ G/ Y# i& O! V6 u0 g! Y0 Yend
% t7 J$ [$ u) F- D5 L: s6 \5 Z) b7 _5 T8 T( r
其中的procindex为整形,代表当前process的序号。
, D# l* P8 O) E2 E8 ~  k: E9 [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-9-16 16:53 , Processed in 0.016222 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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