设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14374|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, A# {1 @( Y% H. _) o

0 {4 B/ ]  ]7 Z3 h" i: V我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) m- q6 M) D  i8 E9 c
5 `9 [) L  c  q* R9 p0 ~4 Gbegin P_read arriving
0 e( a% R; ]5 B5 ~# p    while 1=1 do begin" Z1 ]% b3 M! j3 O( b5 D5 Y' W
        read A_tote from "data.txt" with delimiter "\n"
% i' t5 b0 J0 a# G. [        read A_time from "data.txt" with delimiter "\n"
" A1 L3 m+ m9 F. T8 x        read A_leave from "data.txt" with delimiter "\n": ^. b. I5 P% O1 z8 }7 C
        read A_picks from "data.txt" with delimiter "\n"
4 A% ~% O4 Q. p( t0 s! q) M. J        set load type to A_tote' }+ v) W  b$ n6 l
        if A_tote="tote 1" then set A_induct to 1
& M/ F! T% }  R( |8 U2 k        else if A_tote="tote 2" then set A_induct to 2
, ~& ~( B5 i% `  _5 g0 F1 D            else set A_induct to 3   
! [& I' z- X2 D        set A_i to 0
6 }" g0 x% B/ P1 g1 P3 _1 m" s        clone 1 load to P_induction
. g  S8 }  q# ~+ U        wait for A_time sec
4 P, a" u3 T" |7 W" u    end$ i, _, l2 G. n, V$ H* H
end
0 Y; Y* L( Y7 d9 L
- C# {9 n: Q' K! H/ Wbegin P_induction arriving
5 g" V4 R6 N% T3 z    if A_induct=1 then clone 1 load to P_pick17 }/ M) K# p% |( j# w# E: a- |
    else if A_induct=2 then clone 1 load to P_pick2
! E. y3 W9 Z' ~4 _" {  P  X) w% {/ V        else clone 1 load to P_pick3
2 G; H/ I$ ]- \' a' f. B/ W; i1 p' E8 Tend
5 e7 b/ g( E; W4 z9 g; f* H# v# q& E# U4 H7 x! A+ x! Y
begin P_pick1 arriving& `. W& b  z# k3 h7 h/ ]
    set A_i to 1
" J% C# [1 ~8 k. C7 Y9 I# k- P$ h    move into Q_induct1
1 j; p5 f# u' H  z1 C- s8 R    move into pickaisle.induct1
2 P$ B% f3 D$ d' D2 u; S    while A_i<=30 do begin
$ W) G; O5 b! s        travel to pickaisle.con(A_i)
6 E* X' b; _$ E9 r! N& j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# c! J, P5 e* o' m        else wait for 10 sec3 O; v6 x$ e  G0 E1 S9 l
        if A_i=A_leave then send to die1 |( x1 h7 H  Y  _9 s
        else inc A_i by 1
( T* m" z5 B+ }/ X; j) s    end" W. t, A5 D/ b5 O! i8 L/ Y" _
end6 B7 S1 f2 u+ u* G* H  D6 i
! G) m' A2 E6 n6 S/ o
begin P_pick2 arriving& \. P% T2 b# R. P6 k
    set A_i to 11% W) H* A& t# K0 o3 G
    move into Q_induct2
7 p! d! e/ h- }; q    move into pickaisle.induct2
" f5 I6 t9 ^0 ], l    while A_i<=30 do begin
2 m/ s7 ]" ~3 r, |! M. T: }        travel to pickaisle.con(A_i)( p: ^' Z  n+ V8 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 y- n, M; I/ b# T( ?
        else wait for 10 sec1 D9 y! R8 @/ `# f
        if A_i=A_leave then send to die
+ c; L  u0 @& n( u" m        else inc A_i by 1; e! w# V! S, j
    end: k: ~" L: |' u. b0 ]: n7 b
end2 U- `+ K: [: g0 b

5 {! h. M. f$ F+ U( u! p8 {/ wbegin P_pick3 arriving- f+ u4 e& N. C) [
    set A_i to 21
% P' `% M' S) e  y: M    move into Q_induct3( d& z6 X; S4 d* O2 z$ h
    move into pickaisle.induct3
' d9 F! E- O2 h" [! _( G    while A_i<=30 do begin9 i4 b$ r: K3 R' h1 x- H$ {
        travel to pickaisle.con(A_i)
( u0 J& z! Z. x! u7 B9 f, }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  v, O: _; m' h9 _8 i: V# i
        else wait for 10 sec
" y# k, w0 S3 g        if A_i=A_leave then send to die2 n6 ]4 _& J# {' y
        else inc A_i by 1
/ G; x" \: [7 t! K    end
( b! e" j0 k6 r9 p6 Lend

最佳答案

查看完整内容

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是个什么东东?
2 C( s( O( q6 L, z* _- ~move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 r1 L; M. ^7 r5 k/ g" r' V5 s; }" ]" `5 S* L- J1 \4 H' ~$ h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: h8 T/ o; ^4 m; Z
; }; v, w* g0 q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. K/ L( [8 p, |) E- K5 P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ \* F% S" B2 l: G) y/ F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 k4 g) I4 V( N# B  Q- h/ B
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:* d2 P% H# W1 U* d5 f0 b3 ^3 j
begin P_induction arriving5 j/ p. g9 @9 j1 ^! j! p& ?
    clone 1 load to P_pick(A_induct)
- _' [, v6 H7 Z, a; Xend最大的系8 Q, ?) q+ Z4 d
3 }7 z; S4 [! X8 L( B
begin P_pick arriving0 @; m3 y3 j  E
    set A_i to procindex * 10 + 18 Y( Y7 J3 z$ s; n+ }7 w( h  a
    move into Q_induct(procindex)
7 ]( n6 V1 z2 `9 I% r) ^& z. g    move into pickaisle.induct(procindex)
8 \3 A, y/ a  D5 q& Z2 b9 |/ \0 m6 [    /*check the type of pickaisle.induct(i), for your last problem.*/
6 V) p& G7 a" c; S* y+ M3 \0 V4 @& f( ]: I6 J6 J
    while A_i<=30 do begin
9 R( U: \( l1 e1 p        travel to pickaisle.con(A_i)
% z. j+ L0 F: G9 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. q- q$ g* u8 \  _/ I
        else wait for 10 sec
+ E$ ~4 Q$ _* t6 K, t3 x        if A_i=A_leave then send to die
- D- H  y0 J; Z" K        else inc A_i by 12 M. H# S! x& g1 K0 K: q9 I' N
    end
" _7 Q' S) {$ J* Lend6 ]' x$ E- Y1 k, a, T% F4 s1 D# H

( j+ Y; ~. w4 h; c  s  ]其中的procindex为整形,代表当前process的序号。
& x" J0 o2 w( P) C- g  |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-7-8 09:26 , Processed in 0.016258 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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