设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14137|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( e. K& N/ e+ {- O2 E" Y3 H$ W4 ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 O- }! |! t8 M0 }
# t. G% v, o" E( [begin P_read arriving: t' {* B) T0 Q
    while 1=1 do begin
' T% Y4 A+ k7 n$ T/ Y# M9 Y4 f        read A_tote from "data.txt" with delimiter "\n"0 ?& w6 M. P0 V+ ~7 Y& H( O
        read A_time from "data.txt" with delimiter "\n", Q# O/ T: _% M" M- E7 z% q" U
        read A_leave from "data.txt" with delimiter "\n"! q' e: Q& K& a; C
        read A_picks from "data.txt" with delimiter "\n"
+ F! n' V9 v7 h* x# x        set load type to A_tote
( U/ u9 v. u( ]# K, c) ~% W        if A_tote="tote 1" then set A_induct to 1
& Z- o# S- f9 \7 Z9 L: f  j        else if A_tote="tote 2" then set A_induct to 2
& d3 A7 l& o$ |; O            else set A_induct to 3   
% T4 n- S- z% K( U% C9 B) w6 X        set A_i to 0
( A! V, p% X) e        clone 1 load to P_induction8 b* n0 F' ?9 Z- t2 ?% M! d0 P  Q+ o
        wait for A_time sec4 X" V: z5 x1 U( O
    end! y' P/ |% h" ?' d) {2 \- h
end
0 j2 F0 \" y6 X! ?. M/ y- n% i0 s0 l. _7 d0 v- ?0 _2 P
begin P_induction arriving% ?9 k: C# M; Y: B
    if A_induct=1 then clone 1 load to P_pick1
2 ^# J6 H$ j2 [+ x4 _' Q8 ~4 B    else if A_induct=2 then clone 1 load to P_pick2
' {2 M. ^/ W) F6 H! a/ d9 e+ H        else clone 1 load to P_pick3
' {$ Z$ c# @1 {+ Mend
& Z5 p% w/ b* \0 o* J+ s' }/ A8 `+ Q$ k
begin P_pick1 arriving
" s( |, L5 c3 Z9 V' W. r    set A_i to 1" M1 X# X. o* O
    move into Q_induct1# n1 ~4 H4 S& u$ m, E
    move into pickaisle.induct1
# H  R7 A4 b& ~6 G    while A_i<=30 do begin
0 G$ z) ]' f& R% E  d; n2 w        travel to pickaisle.con(A_i)" g$ n  ~. ^1 u7 X5 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 o. D" L0 C- h6 j' d; y        else wait for 10 sec
& X. v, s( t2 }& Z' L0 }4 K8 D. f        if A_i=A_leave then send to die
4 e0 ?1 i. T- H; m# P6 f, b+ E        else inc A_i by 15 e( m' A) ]$ v# E
    end. ~0 v! [( `, m& V; b9 a, q( r# a
end' A3 F0 ^# m8 S& n* j

1 j, M9 r* q; `' _begin P_pick2 arriving" o; j  N8 a" Q: A. C7 `6 R
    set A_i to 11/ F2 a5 }! w2 A! a. t0 o, N
    move into Q_induct21 A+ r& H  N, V2 J5 o- ]
    move into pickaisle.induct2
* l( c1 n# t7 y/ W( `6 d    while A_i<=30 do begin
1 G8 f7 R& S4 r( y9 ]( A        travel to pickaisle.con(A_i)
+ O3 B2 A1 ]# [6 F8 V$ z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, y% ^, S5 R" Y. g& q4 o        else wait for 10 sec
: W% ^& Y, {2 S6 n0 ^; {        if A_i=A_leave then send to die5 K6 _2 t3 K* l1 x  b
        else inc A_i by 1
8 ?+ F6 a1 z( D) O    end
7 P. V; P9 S+ Q) j& b1 T6 Eend
% `1 c, p. t" g7 _: E% \. I7 ?+ d' i
begin P_pick3 arriving
8 {7 _% v; i0 g( @- n    set A_i to 21
1 D! w1 G# Q! Y/ ~- i    move into Q_induct3
  D- f8 s" T0 @1 l2 Q  f    move into pickaisle.induct3+ z2 q* G2 i. c5 @/ R- X' R5 {- T1 g/ S
    while A_i<=30 do begin6 |; v; b# i; R0 ^6 r
        travel to pickaisle.con(A_i)6 Y% ^2 N0 Y: a9 W5 J, c/ Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 P( a( Z2 i: ?        else wait for 10 sec
# O, C1 x! K7 _( x; ?        if A_i=A_leave then send to die
2 \! ?4 Y8 L1 x  B7 z! h/ D) E- r        else inc A_i by 1+ n2 A! z+ Y& t
    end+ @  n4 G" x( @  s, z3 x
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是个什么东东?+ W) D+ ?( I3 U( v: ~; o) c
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! i" d: G2 P9 i) S; r
" C9 s* A8 j  i2 rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) D, E; c$ \- F) W; q
" q: ^0 g; S( C另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 a8 v3 |$ I, Y5 ]# d+ L' |
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& |5 V2 Y' V) W% B# Z: n: \0 o2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! _4 C% `+ c- q0 A- p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ b& L" G" Q* X/ dbegin P_induction arriving/ [+ k; j& ]1 Q/ a1 `2 J- Q( h" Z
    clone 1 load to P_pick(A_induct)
& t( J6 m( m$ X1 Pend最大的系
, a/ l& V2 `! ?$ o' a* g' U6 m" K
begin P_pick arriving
: _; r! g3 R5 o) x* k2 z* }    set A_i to procindex * 10 + 1
4 A  y- g8 T( B5 T    move into Q_induct(procindex)% w7 k5 ]5 n/ ]% u! J
    move into pickaisle.induct(procindex)( T" F4 s) _  [: A- ~/ h
    /*check the type of pickaisle.induct(i), for your last problem.*/
5 `& h- D+ @; b# X
4 f$ Z8 y% p  b    while A_i<=30 do begin
9 C" \4 I5 K4 \: t; ~  q        travel to pickaisle.con(A_i)0 F" X' P  F, q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* \: k  _! ~  W4 a2 N3 q4 v8 C        else wait for 10 sec
$ j4 m" b7 O( i. Q+ w! l$ c        if A_i=A_leave then send to die8 p6 [7 R% N7 \2 R7 J3 L
        else inc A_i by 1
% Q! m" k) R/ \/ ^! P# Y3 K    end
/ v5 b+ e& i. ~, C- [end
' L  s# Q0 N7 ^5 r/ c" Z9 c; [( L$ @! \
其中的procindex为整形,代表当前process的序号。! E/ A' k% I  v- o4 o
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-6-12 16:39 , Processed in 0.014911 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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