设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13077|回复: 2

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

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

: a0 q& I) V4 C, m& P" A我的问题是,在每个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中的数值,不知道会不会有什么不妥。# _6 l" M% B% Y

7 h1 |. N7 @( Fbegin P_read arriving3 T# W+ f- L0 v8 e0 y% V5 r* i
    while 1=1 do begin
$ t3 S  k2 H9 C. _; ]3 U; a        read A_tote from "data.txt" with delimiter "\n"
6 O9 p% E- L% _3 N( O. B' k8 X        read A_time from "data.txt" with delimiter "\n"$ d8 I7 X5 f  `! E% r5 R
        read A_leave from "data.txt" with delimiter "\n"
# `3 P8 l  s/ j0 J6 }+ n        read A_picks from "data.txt" with delimiter "\n"
! T" y* A7 B  q) b( M        set load type to A_tote
4 V. o6 ~* \: w3 b0 s1 i. g        if A_tote="tote 1" then set A_induct to 1
4 r! [8 r- M4 q' O        else if A_tote="tote 2" then set A_induct to 2
. A, O5 s+ i; h# ^7 ]            else set A_induct to 3   
& y" }) D( s* f2 r9 |" m. |% ]        set A_i to 08 ^7 u7 Y' @3 L2 b
        clone 1 load to P_induction
- u2 _1 F5 b* w2 X. f) ?  b& V        wait for A_time sec: H& w& }6 [3 O$ o6 ~0 l3 Z/ A2 S
    end
0 d$ i" M. m7 s* K& _end+ G! c. h. Y: Q
. j/ @" ?5 m% f
begin P_induction arriving
; f" F9 }1 l. N& f& y    if A_induct=1 then clone 1 load to P_pick1* g& C0 {( ~: j( N- A9 v+ L
    else if A_induct=2 then clone 1 load to P_pick2" y4 @. g4 I0 O, V4 S, v4 m
        else clone 1 load to P_pick3
4 V9 y$ p# ~: [end
7 V+ K2 a- {) I8 y. n9 \0 X) S* @) z; B; \
begin P_pick1 arriving/ a; \( U$ z; ^
    set A_i to 1
2 M1 p" T6 `% N- q+ n    move into Q_induct1! e( x. k2 Y" {7 Y' \4 x
    move into pickaisle.induct1
- k9 p9 d+ B  f* @8 M) H" V6 F    while A_i<=30 do begin
1 r/ n5 s) q7 r2 [6 h5 p        travel to pickaisle.con(A_i)
/ g8 w+ s0 s- q6 n: K/ [4 s; t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 J4 v: v2 ]7 t
        else wait for 10 sec
! X) q, @2 G# q: y0 ?1 W9 r* W        if A_i=A_leave then send to die
8 o5 j& X" _1 g- N+ p/ a  b        else inc A_i by 1
4 \4 A% H+ ?# c/ g0 g' [    end
$ `% Y' O+ A8 w. yend6 g3 C4 U8 ^! E# ?, O% `
, Y$ ^- l/ j3 i
begin P_pick2 arriving$ m% I5 G& J5 }6 E8 t6 J$ t# z, g/ S
    set A_i to 11
0 H4 U, A' ^; `2 ^, _/ G    move into Q_induct2
2 L* y3 L$ D# }7 _    move into pickaisle.induct2
0 _1 b, ?5 ?0 g6 \- Y    while A_i<=30 do begin  h% R% T* f. ~+ N/ `! f/ S- }
        travel to pickaisle.con(A_i)
5 E- q  B2 H. d  a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 i- q9 m: E- _$ Y: P2 Q4 _
        else wait for 10 sec9 s, g$ |& M" ?
        if A_i=A_leave then send to die
% l/ P, ?+ x. C$ }/ {        else inc A_i by 1, c* i1 v' j2 f% d
    end$ }; Z6 A/ ]' K- Q4 n
end" K9 y8 z0 d4 [0 F8 H
4 a7 w# v8 a8 M  z9 \
begin P_pick3 arriving
  @% d- j5 X5 z- s8 K    set A_i to 212 `+ L9 I/ M2 `/ g
    move into Q_induct3. t* T$ L0 M. [) {+ Q
    move into pickaisle.induct3
: x. I! L8 [4 L. N. m    while A_i<=30 do begin
) b# P/ l" c! V) K/ K        travel to pickaisle.con(A_i)6 i" g; S5 n) z# {6 @- O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; Z  F' i7 ?/ F
        else wait for 10 sec  x( h9 |9 {! {
        if A_i=A_leave then send to die/ f8 }' Q' n$ {( l0 S
        else inc A_i by 13 W  E) U. Y' v
    end
* `* T/ Y2 ^8 L6 Q8 cend

最佳答案

查看完整内容

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是个什么东东?
4 j* s: E  F! d6 ymove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( q% t/ G1 a: O" G- d
  a  }$ T& s4 |  A- F$ ^- sAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
- b+ Y% a: o; _, j0 b- z
3 }, x/ W. p0 J' H2 D8 k1 p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! J3 s, u1 k9 K$ _6 m0 q1 P- h* D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# Q% K5 P' f2 P; a' \2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 j3 f7 E' l( s3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% ]$ m# ]0 ~( U8 R* B: v$ c; Sbegin P_induction arriving
1 T# g+ f' m0 m9 \. ?7 b: I- J0 Q" |/ Z    clone 1 load to P_pick(A_induct)+ f3 c9 j. \0 d5 g. t
end最大的系
+ P9 ]& b+ Q: F% }
# {4 `% @. v  z- b8 h; E- }begin P_pick arriving
2 N4 P+ p1 K5 c; u    set A_i to procindex * 10 + 1
1 c* E+ W0 ?0 z2 d7 W    move into Q_induct(procindex)4 _' n$ ~; ^, s3 H; B; R
    move into pickaisle.induct(procindex)
4 F6 r6 J; L3 B5 v    /*check the type of pickaisle.induct(i), for your last problem.*/+ q; r) k& f7 V( ^) t4 i* l

4 N+ M9 {! Z( _) [; i8 }! x    while A_i<=30 do begin
5 D/ V; [& I1 }5 G        travel to pickaisle.con(A_i)
% x! W1 I, F- T$ k4 t: F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- }9 ?9 t# z$ f* y" ^% G, P8 G        else wait for 10 sec
! y% ~; {& y3 O0 Q- z        if A_i=A_leave then send to die
8 i' w, K/ J+ [5 _        else inc A_i by 1
# P% p% g  U6 |, B8 ^. W) F    end$ L7 j! a/ B* `
end. Z7 |' I: _' S  W

3 A! m+ m1 p/ ^3 f" [3 q5 S其中的procindex为整形,代表当前process的序号。+ n8 a6 d2 C; h7 n. R) W
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-16 08:58 , Processed in 0.014769 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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