设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12436|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 H; [% G6 {) v. ^1 I

$ K* ~/ |, Z1 ]- g我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 X. B# H/ `$ ~4 L* x
. D! X- B+ |& y$ C1 G2 |begin P_read arriving8 {. A+ n' {% Z4 x0 z6 G
    while 1=1 do begin
: P! J' {; W- w6 F        read A_tote from "data.txt" with delimiter "\n"
1 l/ j7 c: W7 M4 s1 w        read A_time from "data.txt" with delimiter "\n"! \+ m) G& Z# E" g- Z( J" {( G
        read A_leave from "data.txt" with delimiter "\n"
6 o( }! W7 @/ P" U        read A_picks from "data.txt" with delimiter "\n"5 g7 a/ |! A5 @, Y1 ?4 A
        set load type to A_tote. H5 s) K' k( J: v" n1 Z) Z
        if A_tote="tote 1" then set A_induct to 1
1 N, V' J/ N, L; T$ w' h        else if A_tote="tote 2" then set A_induct to 20 Q9 L2 P+ X: y. h3 D/ M- m9 ]
            else set A_induct to 3    + I6 k7 O" o3 V
        set A_i to 0
& r5 R6 }, K1 ?) ~1 Z        clone 1 load to P_induction
! N% R# E/ r0 C        wait for A_time sec
7 R4 C" `/ _- I$ W    end: @  p; z5 @" x1 E! S5 t! Z
end. @. Y' V! o! \- Y6 T

0 n0 d7 M# ^" ^begin P_induction arriving+ B6 u; y# V- W- Y0 a& F
    if A_induct=1 then clone 1 load to P_pick1
8 P, x, N% a) G9 p5 X    else if A_induct=2 then clone 1 load to P_pick2
, R0 D3 D* h. @        else clone 1 load to P_pick3
/ ~5 E, `* c4 M$ s' @3 T4 N/ Send1 F4 o& b0 j: _7 s4 m  y# S

/ p; B- S  v$ E: Sbegin P_pick1 arriving
; {2 i) M) u# y7 n: n3 N    set A_i to 1% m: ]+ y! B0 N! s, V
    move into Q_induct16 q; K+ ~! l4 x5 G! k
    move into pickaisle.induct17 Z# B( t* B- ]+ q
    while A_i<=30 do begin
$ f) V! n( r2 A& f. b) i3 z6 z        travel to pickaisle.con(A_i)
( P- ~$ }) V. w% w( R5 a' n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 D" O7 y5 x# |! F7 A& }* [  k; m        else wait for 10 sec' d$ H5 Z. c1 u7 X( ]- O
        if A_i=A_leave then send to die7 T' v" t* E# x+ G' j6 E* L$ c$ a4 V
        else inc A_i by 1
  ~& ?+ Y" o% s7 W+ X    end6 d& U, X8 E$ `! [' n: O& c
end
- @! V+ n0 r; ~8 o( t
  ?4 p: e- L+ A* F2 L1 ?begin P_pick2 arriving
4 E/ t% {+ m2 I0 Y1 w- Z    set A_i to 11
4 }' `% d( M, e7 I    move into Q_induct22 g- e4 v; e% y6 }
    move into pickaisle.induct2
) I  l' m& L- m' v* u1 N    while A_i<=30 do begin
% t& b% }) \) @% p5 J        travel to pickaisle.con(A_i)" v3 @- W* E3 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( V; Q; \4 a8 r+ g# n" t
        else wait for 10 sec
' f. `& l4 [% L6 j' z. x; W        if A_i=A_leave then send to die* o$ }5 ~% C7 N( N. Z
        else inc A_i by 1( U) ]$ [6 I" f$ A. H; [5 k0 m! j$ P
    end1 D+ i( {$ i& H  @
end
# \8 s) z2 Q. x& }! m5 b- C. w+ U2 S! D& ?- @2 R
begin P_pick3 arriving
& E. r- U- O: U+ D* S; X) E    set A_i to 21
0 m7 _6 g3 g5 C    move into Q_induct3
' |/ q; b$ \3 g) k: M. H; m5 ?/ {    move into pickaisle.induct30 T7 U' j$ V; x8 R: ^
    while A_i<=30 do begin
: N' q9 _1 f/ H+ z        travel to pickaisle.con(A_i)
" q) B0 V, D9 E4 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) J1 g8 @* |" d& F9 d        else wait for 10 sec
  S0 C( S2 D8 y. l$ ?) Y' L        if A_i=A_leave then send to die/ {- d3 }1 b2 \) A: Z
        else inc A_i by 1
: C) [/ c. G2 p1 d( X( i: A    end
2 T& K, `3 J2 d2 _. k  oend

最佳答案

查看完整内容

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! t0 _% Z) s7 N1 Imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?5 {' i! a% X9 {, }
4 J/ a7 b: l& o# C2 G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% v( I6 d5 K- G  P2 ]  R" s% ]& S) H( g0 o& G, E* _4 k
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
' g6 U5 K: B' J5 K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 {; B: C, M  V5 t& M
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 u" ^2 ?* _1 q5 H4 D2 D" }0 \4 R7 d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ ?  _; V( V! V& \+ c) J- C0 S1 zbegin P_induction arriving
/ Q9 o' I0 @7 u/ A    clone 1 load to P_pick(A_induct)
( ]9 H- p9 B: m+ Z$ d. hend最大的系
4 x) W: @: U4 S, |  D5 G- Y- m5 \* I0 p4 v' V, e+ i& |  e$ V
begin P_pick arriving0 J; P1 n" R0 f" x  H* y
    set A_i to procindex * 10 + 1/ C; [8 J* L3 P8 W# j0 p
    move into Q_induct(procindex)& c* p; j) w0 k/ Q
    move into pickaisle.induct(procindex)
! k* F& G, ^1 g7 Q$ I+ e8 f; i    /*check the type of pickaisle.induct(i), for your last problem.*/; Q1 J  }4 _) l, F' L  W/ O( E3 M, X
) Q  w+ o5 [- @
    while A_i<=30 do begin
# n, A9 E/ g( G+ o1 s& e        travel to pickaisle.con(A_i)  R, s4 h5 z3 t( k" e# C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  W; ]/ f+ O) g2 t3 x1 w- N$ G        else wait for 10 sec- O1 Y9 x/ p4 J* l5 z6 W
        if A_i=A_leave then send to die
1 ?7 a1 Z9 t+ r7 D+ z9 s/ p: M        else inc A_i by 1( s* `6 N3 U4 N4 `2 x+ z" U6 d2 U9 K
    end
! V  E6 n7 s2 M: fend  d- d* N/ S/ V) |
! j* d  e$ J6 t5 U& ?8 ?' r" ~0 C
其中的procindex为整形,代表当前process的序号。
7 ^& l3 D( k7 a/ A6 zstation和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-1-23 11:21 , Processed in 0.015277 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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