设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13211|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! p8 P, e! P3 {
8 Y% p0 ?4 n4 i: ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: u0 V: `" n$ L' ~, h3 T# Z- W
0 G( Q% M) M( C: _
begin P_read arriving1 }$ p+ L4 ]4 D" \4 I
    while 1=1 do begin3 [+ X! y  N' f1 x: }3 }8 E6 W
        read A_tote from "data.txt" with delimiter "\n"
" I$ ^! H0 ]$ a# b) c" L        read A_time from "data.txt" with delimiter "\n"2 i% I+ K  W8 I0 [
        read A_leave from "data.txt" with delimiter "\n"
# q0 T2 z* K4 W7 o4 {2 O        read A_picks from "data.txt" with delimiter "\n"6 g5 y3 h* O5 X+ b7 Y
        set load type to A_tote
0 U8 c- z; I& ?7 n5 m        if A_tote="tote 1" then set A_induct to 1; s5 j' I- S" q! d/ i  V7 b
        else if A_tote="tote 2" then set A_induct to 2
7 y8 `: H5 M/ _) e, U: Q            else set A_induct to 3   
* H. N" Q! D5 }" H% T        set A_i to 0$ G8 p0 L; z" @5 I+ V  `
        clone 1 load to P_induction$ z9 k/ v& K: W, ^9 H
        wait for A_time sec
# s3 y" a) j8 b" h    end
1 Y, o& I7 z! N- V! Nend) w2 a; p. ~! z7 ~2 f- a
6 Y. m; h/ E, J8 A
begin P_induction arriving
; z$ A0 x1 ^, l: ], T    if A_induct=1 then clone 1 load to P_pick1- _* ^5 f+ b) L/ ^/ ~  x9 Z' L
    else if A_induct=2 then clone 1 load to P_pick2
2 s( b- j! v7 k+ S+ x7 c# D- j% b        else clone 1 load to P_pick3+ t9 {& q, v& Z* W* Z6 G# q+ A
end8 g  N0 g# ^: u8 B1 @
5 T6 ]) U0 B# I4 W8 c6 h: W
begin P_pick1 arriving
1 W4 P4 b  S& o0 D6 X    set A_i to 1
8 q  T5 Z4 E; }' j    move into Q_induct1
1 G/ D, |. G) K" N$ M& e    move into pickaisle.induct1
+ `) b2 m/ ?. M4 J* H1 P* i    while A_i<=30 do begin7 L* b2 T0 L: y/ q& I2 {  B, j
        travel to pickaisle.con(A_i)
" S/ J- V  O6 S0 g/ t, c$ Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ J" V, O( S3 q' z4 I8 A1 D
        else wait for 10 sec3 C2 O( J7 ~* V3 b9 @
        if A_i=A_leave then send to die
# l& Z' P0 z. [$ v( g        else inc A_i by 14 H& W' L& m$ S1 h
    end
! _" s* h6 l1 ]) ^) M- T; Z8 ]end
5 C6 n2 m* [) Q3 o8 x8 c7 T1 j5 \% A+ q+ A) |- X( @
begin P_pick2 arriving
+ M% E0 [) U+ j7 p0 |2 e    set A_i to 11
; Q! X9 J6 N7 p0 y; p    move into Q_induct28 G6 R, \5 u0 `4 d
    move into pickaisle.induct2
9 H& l: N& n7 R* i7 i4 Q    while A_i<=30 do begin
$ z: G1 c7 u: z7 m0 H9 k9 D! Y9 q3 K$ p& M        travel to pickaisle.con(A_i)
' w# B4 k9 M. f3 Q4 V8 O! Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Y( |/ T; r: l8 U, s
        else wait for 10 sec% B3 d9 ^  t  L- ], Q/ x
        if A_i=A_leave then send to die
- ~# l, ]0 e3 v5 S$ H: z6 r" M) b        else inc A_i by 1
( [# s) ~. B3 k    end
9 t: m: t& \5 O9 h  bend
" m$ O$ |" Q# E
% J7 k2 l, ]" k2 L& h  C! K, Lbegin P_pick3 arriving$ J) a+ p& k$ R( q8 m1 k9 E; p
    set A_i to 210 V% w* b( |$ O( C
    move into Q_induct3
) Z, S' m1 {/ W. E, f) Y* b9 i    move into pickaisle.induct31 S! L  o$ e0 A0 j" J% D' r
    while A_i<=30 do begin
! K0 L$ t' H2 _; k9 X        travel to pickaisle.con(A_i); L* K$ w7 _. ]! v" A6 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- a0 m! }5 K7 q& T' f2 k4 U        else wait for 10 sec
: B* f# N$ F! D! K* G: b) Q        if A_i=A_leave then send to die
- G7 L! a8 j5 }( R" H2 p        else inc A_i by 1( d& ~3 @% w- g  d$ B! Z" l
    end
. g  T) g/ S7 d: g2 n* U% Xend

最佳答案

查看完整内容

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是个什么东东?
7 C6 G! i0 Z1 G1 r7 nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) ?! b  E' h( o# o: \5 h
% v3 ^% x5 F$ R$ R* a8 p, D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ X; D1 L/ q: K% v, v
, V  u, Z( X  K- U1 ~, W另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: |, P; H" G2 {& c) _1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" G5 {2 \7 N/ b8 R2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 M$ a! Z" H2 A2 n, Z) D3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( U( Q. u4 {9 u& p# Nbegin P_induction arriving
& [6 D; F1 r3 s+ l) A+ v    clone 1 load to P_pick(A_induct)# M5 r! C$ T1 \7 N  k. }) ?
end最大的系; r& s/ o0 |7 _( z! K- Y. N

" N: ^+ m# o' \$ z0 e! F( Bbegin P_pick arriving
/ M) Y* p. N. `4 P0 l, M# Z: `    set A_i to procindex * 10 + 1% ^5 U# o/ k6 A# p3 p( f3 o
    move into Q_induct(procindex)/ L2 {8 x& J' ?  Y9 Z+ K
    move into pickaisle.induct(procindex)
/ s0 J. K' D, V; ~; ?$ M    /*check the type of pickaisle.induct(i), for your last problem.*/
- F1 q; k- ^6 d& C2 n
- m# J$ p% k$ Q8 d    while A_i<=30 do begin4 v& P, s; Z/ a6 W
        travel to pickaisle.con(A_i)
# _  O8 z+ z5 L& x- N" B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. p3 z1 \8 g9 ~1 [6 b' ~2 U
        else wait for 10 sec
3 y, e9 T  S0 T( W# O; }        if A_i=A_leave then send to die
, o* k- ]4 R0 `1 f+ c$ w% N2 r, Y        else inc A_i by 1
2 e6 G+ I# c4 f    end7 m4 D2 U4 T9 R; r1 R8 a0 [
end, t, x- M- L! w

6 t: Q6 [& e2 Q其中的procindex为整形,代表当前process的序号。& n6 Z' X' U+ ~. c3 y
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-27 05:10 , Processed in 0.017549 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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