设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13142|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) a# R* z* T- a, q. u3 o3 E3 @( N6 H

; J5 n( T# @' o8 s9 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中的数值,不知道会不会有什么不妥。
+ l/ l) x: I( E5 r8 x2 y  o7 {; t) s
begin P_read arriving1 Q% O% c- l/ ?6 G' D( s" H
    while 1=1 do begin
( r$ i$ s" U+ I2 i5 F        read A_tote from "data.txt" with delimiter "\n"
* S5 @! G% M2 m7 m4 m: H        read A_time from "data.txt" with delimiter "\n"
1 u. y2 g) k) t7 V$ ~' r        read A_leave from "data.txt" with delimiter "\n"6 @9 T" F9 `8 M- p
        read A_picks from "data.txt" with delimiter "\n"9 |8 C2 u8 l. q$ z5 k
        set load type to A_tote
- s5 D3 ~- _& i" h2 @: u4 w2 l# X        if A_tote="tote 1" then set A_induct to 1; L6 I# |& ~( \5 r! \( z# i
        else if A_tote="tote 2" then set A_induct to 2% ?/ C- C: f" }# Y) C' W& G0 y
            else set A_induct to 3    - `/ l9 Z/ K' m4 y* E0 I
        set A_i to 0
$ ?) K, a/ e  O9 d% c  E        clone 1 load to P_induction
$ z9 I$ m7 L" c1 `$ w        wait for A_time sec
5 T& D9 L. H  @. A# U9 ?    end$ \, t; l2 L# |% Z. E% v8 T
end
  P; p* e* K" Z" D0 j
6 [5 z3 M2 k4 V; L+ A; Dbegin P_induction arriving+ E1 C9 \% w* m. J3 S) I# T
    if A_induct=1 then clone 1 load to P_pick1
& Y. y7 n& P- ?2 s    else if A_induct=2 then clone 1 load to P_pick2+ m: d7 e* M, d6 C( n# K0 ]
        else clone 1 load to P_pick3
4 }) h" g6 o- I8 G7 N# u  Vend. C. ?; c4 s1 P

& R' l& T& v6 Ubegin P_pick1 arriving5 G! u2 e+ y% @, o$ Q/ J8 h0 ~  k
    set A_i to 1
4 e& N$ a% r7 C6 w    move into Q_induct11 H- q, T( g( f/ b
    move into pickaisle.induct1
6 ?: b! ~7 p& K* l) M3 c    while A_i<=30 do begin7 M8 ]1 f( ^$ P( m
        travel to pickaisle.con(A_i)
% M: ?$ Y) M: O. r+ y4 i- o" v, j0 Q& C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 U+ U& A2 n2 L7 U" E% i0 y4 X+ `        else wait for 10 sec
1 C" ?. J5 @& E& G: D3 Q        if A_i=A_leave then send to die
" k+ @; H* \" M( U( N+ A5 J- \        else inc A_i by 14 _. j+ h$ y, E. k4 L8 k
    end
& W' ?# R1 L5 A5 yend- @$ ?+ n" ]! E! g- Q7 K

% l  T: m# I/ R) A2 Y( H! ?begin P_pick2 arriving
. r6 V' Q# y2 i; c& {# w    set A_i to 11# F2 Y+ ?/ V5 Z2 i) i6 w
    move into Q_induct29 B  M* x+ a8 S( S! {
    move into pickaisle.induct2
6 p! c4 V9 L" W& g# S* ^) s" r9 h    while A_i<=30 do begin
1 [9 `) O- g- e* J; l' f        travel to pickaisle.con(A_i)
2 d7 U% f, A1 r( l& V( W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, G3 z1 x' o3 [2 o% z        else wait for 10 sec
$ b/ U* G  H) q- \, F  l        if A_i=A_leave then send to die
6 Z/ v1 G7 S0 A  l" [5 s# ~        else inc A_i by 1
. B6 T# c, e( l  c+ E8 S    end
! I* |7 e4 H. b8 |, ~end
- D; R( ^4 [$ P7 r- T4 s' k
) W7 h0 E8 H2 Y+ f! {begin P_pick3 arriving
: t2 i4 g( t4 L. O" R    set A_i to 21
: ^  K2 \. }$ y4 R    move into Q_induct3
( Y6 @& ~; s4 Y! h3 W3 t3 U6 H    move into pickaisle.induct39 h7 k# Y' \  g: J8 s! m
    while A_i<=30 do begin
# j& U, N+ Q5 [* h2 S0 Z$ V. I) ^        travel to pickaisle.con(A_i)
# Q; t3 S# j, C! O. I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ ^- N7 l7 F& t7 n! E: \& p
        else wait for 10 sec
) R, n* z2 X3 n$ N2 Y        if A_i=A_leave then send to die
; U) w5 H/ A: s, p* ]) v        else inc A_i by 1  Y, h8 L1 A$ |: T6 a
    end
$ P# s( |2 B; S' L; J/ J( h/ |4 Bend

最佳答案

查看完整内容

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是个什么东东?' ?7 v/ j, n- @& ^5 a8 e' ?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 z( X: N9 D1 Z. ~1 F3 X: v1 R8 W  R% M8 k: h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 J2 F* Q5 Q' n. h$ L
* K7 z: J' J4 K! N( V另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 c, B; {$ `, A8 [+ X3 s1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* R) K9 i' b1 Y) P5 K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: I6 U) F# {6 l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ O. V/ g+ |. `; Q- E. Rbegin P_induction arriving* c5 A& o  F/ h0 a4 J$ L$ D1 t
    clone 1 load to P_pick(A_induct). |0 L  u, R! i
end最大的系
" ?3 N$ N7 G" a8 P+ @
( s7 h- D4 I. jbegin P_pick arriving
1 x1 U: {+ I) B$ U( v5 p+ w    set A_i to procindex * 10 + 19 F' X9 l& ]2 S  `; k8 D: O3 b; ^
    move into Q_induct(procindex)
/ a' F9 ?( w2 d5 `" ?    move into pickaisle.induct(procindex)( h% |! H/ U8 M" n6 K
    /*check the type of pickaisle.induct(i), for your last problem.*/( L( C* j/ P8 I. [/ {
/ K6 }1 d4 [9 y
    while A_i<=30 do begin
4 J* P/ I' {! Y& q# {0 j, A' G        travel to pickaisle.con(A_i)
+ w' z* j- P) R& e% B  B3 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- U; u* l  G( V3 x0 v# q
        else wait for 10 sec9 O- h" v( H% o/ ]) l
        if A_i=A_leave then send to die
: y7 K2 L5 W, v, e        else inc A_i by 1" [0 a9 N, C4 g- n7 S' |( K6 j& W( N: e
    end
" Z: d  ^$ }0 N9 [2 b+ N. Nend9 k% V8 F+ h7 o+ a; U
2 b" h& j' H" a1 S
其中的procindex为整形,代表当前process的序号。
- I* `$ n- s7 r6 n; O$ d) g/ m4 Tstation和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-22 01:17 , Processed in 0.022644 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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