设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12420|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ I" p- j/ l7 F7 `2 g# o% z
' n/ b! k0 N; z$ C' Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' ]) ?8 E6 v/ r6 T
; ^5 a* b8 h* J& m" G& |7 dbegin P_read arriving# [  U: h' L1 [& N* u+ J' r) r
    while 1=1 do begin' Q0 O- z# r+ c5 z% X' o  z( N6 A
        read A_tote from "data.txt" with delimiter "\n"' T3 W" ^. e8 u+ I, b$ N
        read A_time from "data.txt" with delimiter "\n"6 J1 Q* ~  r) F( p& U, u# i! r; `
        read A_leave from "data.txt" with delimiter "\n"
4 N% |) T4 }7 T- ~, k( Q' m        read A_picks from "data.txt" with delimiter "\n"
" s4 K$ V) o! K% J( y        set load type to A_tote
; S* j7 \: ]. _9 w; F0 r) n        if A_tote="tote 1" then set A_induct to 1, m* o1 q) q- n  ]# R0 p3 t/ h. x
        else if A_tote="tote 2" then set A_induct to 2
$ U4 \+ p6 Y$ `3 y8 X            else set A_induct to 3   
3 X2 k" j+ v+ }% C9 F8 m        set A_i to 02 @6 g" M& E$ D
        clone 1 load to P_induction- ?3 R5 Q9 v5 `. ?+ f
        wait for A_time sec
5 ~, _* D4 f, F    end
4 S2 V  T) Z$ x0 H/ f) fend
+ d. |6 i* L  C. `! Y" m' [% ~# d& G1 u: S7 [" E6 S; C
begin P_induction arriving- Y* l* z. `- b+ y6 w+ v7 Z6 P
    if A_induct=1 then clone 1 load to P_pick1/ J9 ^! B) P9 U$ s( \
    else if A_induct=2 then clone 1 load to P_pick21 ]7 U* x( H& k2 \8 e5 }
        else clone 1 load to P_pick30 ?' h- t4 ^" f+ L1 u9 [
end. Q3 {; C& C! G: T1 O
6 c+ Y/ }  E3 [4 E: B$ ?: |- k4 _
begin P_pick1 arriving! |% T! D* F7 i8 @* O# a
    set A_i to 1
/ B) j/ M9 u4 |8 g# L' A    move into Q_induct1
0 ^& L8 ]# ~2 r7 P/ e( _# ~    move into pickaisle.induct1
) E4 F, T# {& ]# l    while A_i<=30 do begin
6 s! u0 t' U- {3 j7 L+ P        travel to pickaisle.con(A_i)
% S( O0 _" x+ F6 b/ }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' h/ {+ q1 D# b/ \0 e
        else wait for 10 sec
, ^' W5 k6 B- I+ [* Y        if A_i=A_leave then send to die# a+ ]! A8 l' w& A, g6 x+ {
        else inc A_i by 1& ?3 r& F" o) s& o
    end) B0 Y# l  R1 t& L- i6 k! E) B' ^2 W
end
2 m  _0 w3 c9 {; L( h% L: P9 l: U" P$ ~7 a0 k/ I
begin P_pick2 arriving
1 W4 g& ^, x  k) u    set A_i to 11
, ?3 x8 B' E4 r( b    move into Q_induct2  i5 H. O' \7 I$ b- Q) Z0 K
    move into pickaisle.induct23 Z. n2 e# ^, L
    while A_i<=30 do begin7 T3 Q1 Q% X2 ~5 B$ ]" G# D
        travel to pickaisle.con(A_i)
1 H% {% h! D9 I/ i$ _4 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 r7 L& {# V" F3 c* N/ v        else wait for 10 sec" j: d7 i* {- ]+ H- E
        if A_i=A_leave then send to die
. ?& o. t; \" S; s. R5 ]( j; I        else inc A_i by 1/ I& `5 [1 ?" ], ]  V" W# ]
    end
) y3 J+ f# ?. o3 `- T  `end) r2 _9 V8 X7 m' g8 W/ j7 Y
5 a9 v, E2 ?1 J% I- \
begin P_pick3 arriving1 _# D7 Y% ?1 y. p% w# q
    set A_i to 21
/ Q8 f/ Y& ?& N3 T    move into Q_induct3' `. Q/ F6 y% z8 ?' \* d$ @
    move into pickaisle.induct3
* \: @. G8 W7 q+ p    while A_i<=30 do begin
3 U9 B+ F9 n6 j( Q  p) t        travel to pickaisle.con(A_i)
% g: {, u6 H  U; x: q* ~0 {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! N3 t1 n" _! E. z  t* E
        else wait for 10 sec
" p3 f, N8 h* W" v& ?) l! o        if A_i=A_leave then send to die( c- X5 P! ^3 _
        else inc A_i by 1
* x- a0 T* Y  U+ w    end: C2 E& [# D" w) R8 [& _7 E
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是个什么东东?" C9 A: c3 Z1 A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! Z2 p) g2 O& G6 w

$ z, x; H3 |- o4 q2 Z" Y* w( XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 y8 C6 ^+ \8 x/ U! m8 @7 G6 f
% [, \, T3 r: K4 ^' h
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 U2 i/ p' m' A( V* Y5 W. d1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' [% W: C2 O3 q9 ?+ y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 g9 D% h$ ?6 h+ {2 e6 V; N* p3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' `8 u, b' `9 hbegin P_induction arriving: M+ V5 t9 A7 i! f7 ]: w0 j0 b8 ~" M
    clone 1 load to P_pick(A_induct)
4 m  f6 k% o5 ]3 x. O4 A6 Z# Aend最大的系: l* \% y+ l6 b$ I

  N9 o8 L5 w" ?& j9 S2 [1 xbegin P_pick arriving3 B$ _( I! B7 R1 P% G
    set A_i to procindex * 10 + 1( w  w) ]( b+ o3 X7 v3 ]( U1 ^1 W
    move into Q_induct(procindex)
! M. e/ {/ q) Z4 O( l- d5 l4 T    move into pickaisle.induct(procindex)
# p8 x4 q; G1 F& [6 a  w0 d    /*check the type of pickaisle.induct(i), for your last problem.*/' [1 l, K6 U/ q  l; n8 U# |% ^( q

! F' w, I! A3 }$ p- }    while A_i<=30 do begin
9 ?9 [, ~7 V$ L! J5 }) Q2 Y        travel to pickaisle.con(A_i)
0 Z8 B' s! I4 h7 P, f# [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 f2 v. t. Z# f        else wait for 10 sec
0 c' r( W) Y  n7 c: [7 o& Q        if A_i=A_leave then send to die3 E4 K, U* h0 ?6 h
        else inc A_i by 1
" [, d( Q5 p+ K# x    end9 }2 V' K' c% l' t, @8 j
end
! [4 E0 q% T9 R3 B  o
. |% C* R4 {9 R: W$ F0 T& v3 H8 @其中的procindex为整形,代表当前process的序号。
: O1 c8 @; W5 Dstation和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-22 02:56 , Processed in 0.021061 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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