设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14193|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" `  B4 }8 m' ?$ e0 m2 u0 }, h" ~" x5 O8 _& F" 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中的数值,不知道会不会有什么不妥。
9 V; q; U. l( F; G1 ~( \
2 a- k1 ^* @0 S6 gbegin P_read arriving
6 y. E9 k/ h4 J* A; \' G- m5 _    while 1=1 do begin
% t; \4 K  ?$ [" @+ n$ V        read A_tote from "data.txt" with delimiter "\n"& K0 N/ U' {; z9 }, l. {* a
        read A_time from "data.txt" with delimiter "\n"
) i- R  c1 U+ U# ~        read A_leave from "data.txt" with delimiter "\n"
3 m& v2 z7 g# B) Y2 r! @8 o- [        read A_picks from "data.txt" with delimiter "\n"
% ~! z* B: N( H+ v9 v0 c2 p9 c        set load type to A_tote  Z, \" \9 l- E! w7 I/ V
        if A_tote="tote 1" then set A_induct to 1: S( A/ s2 v: `8 a
        else if A_tote="tote 2" then set A_induct to 2
+ S- w* Q3 ^/ d! F            else set A_induct to 3    / h5 ]8 [7 a1 B* }$ q! _, ]0 ~
        set A_i to 0
) t: P3 P6 a7 e7 f3 ]$ V        clone 1 load to P_induction
% v$ s0 \0 G& H+ J; T. X( m, B4 T        wait for A_time sec; Q+ v' u' w' H
    end+ R5 d7 j/ g. Q( k2 O
end
: u2 `* W( ]  r4 _0 q! `$ A3 L$ X( l- w$ p8 F: }! W
begin P_induction arriving
0 ?* w  Y) G6 S; I* v3 S% N    if A_induct=1 then clone 1 load to P_pick1
, n3 R8 F! k) ]5 D+ h4 V* v    else if A_induct=2 then clone 1 load to P_pick2
9 G: w7 j9 a# F# B  W) _* d        else clone 1 load to P_pick3
: N$ W" P- O0 ]8 L. Q/ Send
  I: P% W' j7 S/ |, e
/ c% J( Z+ F3 W0 |% vbegin P_pick1 arriving
# G- Y/ h" x" Z    set A_i to 1
2 Z, W) f0 w+ c6 G7 L    move into Q_induct1/ ?, x* f# W) p+ ?
    move into pickaisle.induct1. E! f7 R1 F. Q
    while A_i<=30 do begin  M3 U5 J0 o9 v
        travel to pickaisle.con(A_i)
9 U' v. }3 s' R) \0 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) g4 a& l; T9 m2 U8 b" z, u- D! s        else wait for 10 sec! J  N: F2 h4 F7 l  E' U
        if A_i=A_leave then send to die
* K8 q' P) t# \' w        else inc A_i by 1" e9 E4 p2 \1 H! h% P, K) E2 m$ U
    end
4 ^; U! S5 T. |7 S; R& t, F$ Pend
5 r+ q( N! ]2 T6 O! x! ^2 p2 }1 J6 u& h; N2 ]
begin P_pick2 arriving
7 d, m3 X% f9 u. O/ O4 R    set A_i to 11
! G- u+ r5 a% k4 O3 A, u    move into Q_induct2
; t- ?! c% @( p$ P  C* o    move into pickaisle.induct2- r5 l8 a7 z6 \7 x" y- M* X
    while A_i<=30 do begin4 u. b6 N7 B/ B( x* y8 m
        travel to pickaisle.con(A_i)
# ?/ \( {/ a" l' z' f+ g9 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 X! q* k4 T- i* N9 u+ j
        else wait for 10 sec
# Q; G% W* N% @. S$ {! J) s$ g        if A_i=A_leave then send to die
: R' p/ z0 t7 k$ E! H        else inc A_i by 1
% a" Y6 `6 `: ^; J    end
( n- ]$ c7 W( F. vend% C9 U' C4 b! b  {- G- B
4 s* ~4 X1 B$ O$ O( ~
begin P_pick3 arriving
, V3 F! r; z: K    set A_i to 21
6 T3 w) v) r2 z$ o& U    move into Q_induct37 g& o& D7 z4 d
    move into pickaisle.induct3
+ D  K& Q6 c$ S9 n    while A_i<=30 do begin) W' p1 f7 x: ~0 J& e0 C* [4 o) d1 @% f9 g
        travel to pickaisle.con(A_i)4 Z* _; ]1 t5 G& l& d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S" Q/ i% D( F- o$ ]
        else wait for 10 sec
4 p/ \0 g  \1 Z+ V) B1 m2 O% [        if A_i=A_leave then send to die
' P4 \9 @! B/ h$ X5 z/ K% Y        else inc A_i by 1
. H* r7 O$ O9 Y3 e3 k% ^    end. r5 a& H6 J4 S+ R! |, j0 L: ?6 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是个什么东东?
8 S# J0 R9 o. ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; }: l! L. G' g( u' m- p
. g, N! j6 x6 w; b. q3 DAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ o( w* R# e8 S, \9 ~* {
. T2 X, n  t' V  b
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 \8 p" `/ b3 |& c6 w; T
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ c) b; X/ |* h  p# v7 W8 m
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" S9 t, u  w2 a- X. e$ q$ J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# a2 r) ?; d  e* p: u, c. U6 mbegin P_induction arriving
& q. d7 H* I& F, h  G    clone 1 load to P_pick(A_induct)
% [; A3 u2 V% e8 Pend最大的系
2 Y$ k# V& |5 L: I! X8 ?, R
1 N( ?- H- e$ H; ~: ]begin P_pick arriving
* b7 ]5 ~6 B7 k/ D5 @4 {. }; K$ o    set A_i to procindex * 10 + 1
" f0 p/ t0 O/ P+ U- u2 |* p    move into Q_induct(procindex)
9 l( u; N' P5 f: B% M    move into pickaisle.induct(procindex)6 B4 ]5 l  p5 r3 x3 L& ~
    /*check the type of pickaisle.induct(i), for your last problem.*/4 e# `: F$ a+ @/ Z3 N( Z5 S8 O

9 R8 O' ^6 P# k8 Z: e; D' A5 G9 f    while A_i<=30 do begin
  M, {4 O5 W$ y5 W; B7 Y        travel to pickaisle.con(A_i)/ }6 s( c* u! {% u- P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& {# o  [9 A' @: u9 i% X+ Q        else wait for 10 sec7 [1 l/ @2 h( g, J! ?4 ]
        if A_i=A_leave then send to die
  a3 i9 o. a6 P" a6 n        else inc A_i by 1
' _. `6 L( Q* C    end0 j6 v( x! u+ n* D! {9 g
end$ ?, B) \4 s) Y1 ]- x

, O: h* J" Z5 r# y: b- o) e' u其中的procindex为整形,代表当前process的序号。# w( C, k* ]5 P* ]9 A. n6 S4 p
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-18 21:25 , Processed in 0.015858 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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