设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12899|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 ^2 x; t( K% Y( r2 g0 ~

3 [- Q0 C0 T2 a+ 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中的数值,不知道会不会有什么不妥。( s" ^* V3 w" c! w' H
3 n& Z1 @, ]3 c. n8 m2 P. }" D) K
begin P_read arriving0 [% y% N7 ]1 Y$ Y$ H
    while 1=1 do begin+ y! B0 g' u, k! ?% O! `$ [
        read A_tote from "data.txt" with delimiter "\n"
- ]& {' r: O" q" l* `" F4 b        read A_time from "data.txt" with delimiter "\n"; x8 _# o1 C1 z: r' z: F
        read A_leave from "data.txt" with delimiter "\n"
4 [2 k( S% A+ h: m/ ?% d        read A_picks from "data.txt" with delimiter "\n"
7 q) ~+ Z' W* \' b0 i5 }. H        set load type to A_tote
0 v: B: H: _) y1 n! a        if A_tote="tote 1" then set A_induct to 1
4 L6 x% \0 ~  e4 C& ^7 k/ s  z        else if A_tote="tote 2" then set A_induct to 2
% r6 l  s0 s; t+ P4 O/ U            else set A_induct to 3    9 X; n8 ^  M7 H6 K% ?) Y; m9 t. {
        set A_i to 0& d5 @. t9 T4 D7 A4 V4 u
        clone 1 load to P_induction
7 c- N- G3 p# V        wait for A_time sec0 ]4 n3 N/ @: N
    end
% ^1 p1 [( N' v" V+ O! K  fend) u4 y" z- `" z2 R) L
1 g; V; A6 C( x2 j9 D, l
begin P_induction arriving, M5 x- H$ W/ c- u& N
    if A_induct=1 then clone 1 load to P_pick1
2 J$ b/ w8 b. N! k    else if A_induct=2 then clone 1 load to P_pick2
# A& a+ i/ c, A) }        else clone 1 load to P_pick3
& E: `5 v8 [$ [& _8 b# r+ bend( s8 X2 v- k1 R
# ]# V7 z: N$ m
begin P_pick1 arriving* _* }9 N5 [( T7 A  @3 F( l
    set A_i to 1* G/ X1 a; m# s; P0 d" e2 y1 \1 m( B
    move into Q_induct10 u- H, r2 p. o8 F' T7 V
    move into pickaisle.induct1
* O7 g# R9 ]6 u  I6 E    while A_i<=30 do begin* w$ ?& w2 Q8 N  x
        travel to pickaisle.con(A_i)) p/ ^* |- q6 Y$ k  H: k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) {1 z" Y: U4 J$ D        else wait for 10 sec: m, D7 v% A9 ], u( S! V8 T
        if A_i=A_leave then send to die
' P- O2 c6 Z4 A8 R/ c" E        else inc A_i by 1
- n1 _& C% k: r' h. C    end
" S- E' x- ?$ D  a. M4 Q* U: v& Q# qend
' g) t: S/ o6 Z) e( O* b+ B
  Z3 P( b6 I8 _) E; n7 Vbegin P_pick2 arriving
% q% e" ^- `& P# z, v( a- x    set A_i to 118 n' z) B7 I6 @4 E* z" G6 ~
    move into Q_induct2
' T4 ?% O. w, g2 ~    move into pickaisle.induct25 ~. r/ L% R3 ]8 N& K4 j: E; v
    while A_i<=30 do begin% m* R# ]% v. C. o! |+ z
        travel to pickaisle.con(A_i)
4 k9 h) P: v) a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! y8 R' i9 d3 F* y3 n6 b        else wait for 10 sec  D! \) c6 Y1 t8 V& I# p- P
        if A_i=A_leave then send to die1 i2 B. T0 F- S. G9 m* k
        else inc A_i by 15 _5 u3 b. P4 L! r. w6 p
    end0 q' D; t/ j* U7 J8 R6 {9 W
end5 f8 c2 Y7 A4 w
! S' v4 _* {$ f% E5 x; F% K& o  I
begin P_pick3 arriving/ k' f- O9 |7 N) V- B6 y
    set A_i to 21' ~% @' d# p3 R5 Z  D
    move into Q_induct33 F- E8 G) U! I3 t8 F# `
    move into pickaisle.induct3
' J6 R1 Z; h; }- s    while A_i<=30 do begin
6 y% @  T: I6 l, U8 r8 k        travel to pickaisle.con(A_i)
7 U: H) l9 g$ f- x4 C0 g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* G% S! p0 \9 j& w& b: l        else wait for 10 sec! [! k/ b; r  c7 {9 s
        if A_i=A_leave then send to die
% s0 |7 U7 q' Y  R        else inc A_i by 1; v6 A+ M$ q+ u1 E* _! d" H
    end% r( Q/ e  I$ C2 W* }7 p
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是个什么东东?. b! t9 O2 F" k- H# t
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 {1 c( c( k+ i. s5 d
6 S; a7 g3 L7 x5 p4 f7 J9 BAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( D% f* d6 H! a: ?6 E. f
9 @$ H# Y5 H* ^! g3 c) {3 v另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 x: k  V, o, T1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 P( k9 i: g3 {& I6 n
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) e2 _9 [) L: M8 {3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 r6 j: M+ |& B! V! ?) m
begin P_induction arriving
8 u7 n. S  c+ Y8 S; b    clone 1 load to P_pick(A_induct)% O' E4 L" c9 t7 z) L
end最大的系7 v0 _/ g8 M7 M
1 s7 G( L0 _2 ~9 B# J
begin P_pick arriving
( _) `* n: l5 u    set A_i to procindex * 10 + 1
( m1 m& e  _# W4 x    move into Q_induct(procindex)
( [" ?9 J- u* Y+ V! w+ a    move into pickaisle.induct(procindex)
; K* w% K; r" _) ^: [3 P+ D% X0 r    /*check the type of pickaisle.induct(i), for your last problem.*/
1 R5 |% E2 ~4 v! R* S5 d6 D1 D3 n/ t: E! z7 e: [4 p
    while A_i<=30 do begin& G& B; \& p' {# d& R# f
        travel to pickaisle.con(A_i); Y2 h9 M! A9 G; Z" n/ B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! b% b8 y( b5 K& b0 Y, o        else wait for 10 sec
  |: w* Y) R& g8 O8 v1 P        if A_i=A_leave then send to die
6 U+ F  W7 _; l/ `; s: H& }        else inc A_i by 1# C" j$ E% c6 [$ S: B
    end
, K* j) b- P5 Cend8 I9 \7 I1 N1 V# Q/ J

  D, |  O$ `8 p0 {) [% C1 N7 @: J其中的procindex为整形,代表当前process的序号。
& K. x& s9 _, e2 x! s7 U# Z4 Gstation和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-1 13:22 , Processed in 0.014049 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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