设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14225|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. z# n  M" ]5 l; L! W1 a

$ J5 K& g* x' a2 ?* ^' G我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 R6 |% q4 f- {/ K4 }. X

7 z/ o6 i% N, Ybegin P_read arriving
+ v" n) x7 e6 w: [    while 1=1 do begin% Y, @+ e4 \$ Q" ?
        read A_tote from "data.txt" with delimiter "\n"% A4 e0 M* Y6 i; {/ [2 U& d
        read A_time from "data.txt" with delimiter "\n"% J, Y* m4 I. ?  m6 g" |
        read A_leave from "data.txt" with delimiter "\n"/ Z: y  Q. J$ c4 ~# Y
        read A_picks from "data.txt" with delimiter "\n"
9 _$ _" s3 i9 p: H        set load type to A_tote
9 B  J1 a3 y8 x5 Y9 s        if A_tote="tote 1" then set A_induct to 1! a0 S% H, @% N  \
        else if A_tote="tote 2" then set A_induct to 2* G6 C9 }5 L0 g/ x8 S9 c  n" a
            else set A_induct to 3    - p4 f2 R- [3 q6 `* m9 u  C5 M
        set A_i to 0
1 |) W* ]8 A* [8 J% O8 s        clone 1 load to P_induction9 _; w) o+ f. ?. S5 X
        wait for A_time sec
5 r0 M) }$ Y6 ~! b! M( p0 P3 B    end
- H8 E) [- ?! `& f4 uend
, C% c/ Z5 S9 A& K7 l. |6 h1 f; |
6 @! z9 D3 Y2 Q$ rbegin P_induction arriving+ p" `( o: _- T
    if A_induct=1 then clone 1 load to P_pick1
5 y" n( w6 a% W* P    else if A_induct=2 then clone 1 load to P_pick26 n( x; S7 I3 q7 N
        else clone 1 load to P_pick3
9 n; h. v; k- G$ v' V( Qend0 L; f1 S6 y* n
5 ?3 L: S) A* ]
begin P_pick1 arriving
) y5 f' M4 Y# h# g* v    set A_i to 1
; d) d- i5 v$ A    move into Q_induct1
, r% L8 N8 l: ^9 W    move into pickaisle.induct1
. E8 H+ ^0 \0 S! o% [    while A_i<=30 do begin" C8 A( r, Q2 Z# N5 f, s9 j6 X
        travel to pickaisle.con(A_i)
9 t9 t$ ~6 O$ n% V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* M: E- X* w8 \9 X. B& p
        else wait for 10 sec
+ x6 Y$ O9 |9 }        if A_i=A_leave then send to die6 T1 B( w+ x  ?( k" d* I: C* I
        else inc A_i by 11 V& N3 z: L$ }+ }' H- V/ x( C
    end/ Z- ^4 F8 F  D6 x
end! X3 g- u: w7 `0 L& E4 W; D% e
' c# |  D& Z4 P* l
begin P_pick2 arriving; u- ?/ L; V6 l6 Z! b# N
    set A_i to 11
2 Q- ^% g; z1 T0 a    move into Q_induct27 w9 ~5 U, ^% n1 C* F! t1 |
    move into pickaisle.induct2; @8 `2 z$ R- A
    while A_i<=30 do begin) E, V5 [3 h. L+ h$ z- O& `
        travel to pickaisle.con(A_i). f# N9 q0 v3 [- I# M. u/ D, P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ e; Q& M2 d, K9 U# `' N        else wait for 10 sec
( o+ H  e/ I# R7 e. j1 _        if A_i=A_leave then send to die
4 }/ ?% `" p- s. X+ P        else inc A_i by 15 V! Q$ Q2 b& K7 ]! `6 s
    end
0 Z0 Y* Z2 g* V. Tend- H$ ^. b- g# G6 I8 B( v

9 k: }$ |, e* l8 y4 w- nbegin P_pick3 arriving
$ @2 ~5 S0 ]; B5 U. F& f    set A_i to 210 |# u! V& ~  R3 B9 X! M! N
    move into Q_induct3
2 Z) _. J. X+ Q; o8 t% {    move into pickaisle.induct3
8 e% [/ @6 O2 A+ O* F    while A_i<=30 do begin
( B; k4 O, |6 ~: i0 t' n        travel to pickaisle.con(A_i)
8 e0 |- i9 t" D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d( _1 _4 z. f* @: i" s1 j' B- r
        else wait for 10 sec
0 U* y6 j( V  r7 Q; L        if A_i=A_leave then send to die4 j9 A0 m0 c) U" {6 Z
        else inc A_i by 1, M+ \5 m: O: L5 z
    end
: y5 @3 x( N. f# wend

最佳答案

查看完整内容

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是个什么东东?
% X# |8 Q: E( a  s9 y/ x, bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
. a+ h# x. k( O; B% u+ P4 q
9 k! V1 ~! \; WAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( U/ y/ T. A) D5 g/ l9 P
4 A6 T" K! W$ M6 o  @, A另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% G# K& O8 Y% T. d
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
, x) k- F- t4 b0 ]5 }. D8 F2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" S. r7 y$ v) i& q3 y3 I: C
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, L& U) F9 N4 i' k
begin P_induction arriving' w: w/ [5 F& N1 E0 `4 Y* L
    clone 1 load to P_pick(A_induct)- E* a$ Y* A$ J& h3 F# C& z
end最大的系5 h" q( z6 ~! g9 G3 l! ]
- E6 p+ _5 V) ~7 i, |$ O
begin P_pick arriving
5 Q2 w9 ^4 i  b7 f3 L' d+ b4 d' F7 W    set A_i to procindex * 10 + 1
, i. p* m( J/ a    move into Q_induct(procindex)
: d$ |: n6 M7 `, q1 q' s    move into pickaisle.induct(procindex)2 Y3 x7 M0 K6 P
    /*check the type of pickaisle.induct(i), for your last problem.*/7 p5 V- S  l: K8 L

8 N& k  e2 M3 P' {4 a+ z    while A_i<=30 do begin2 Z0 U1 f! V0 [8 F  L; m6 D
        travel to pickaisle.con(A_i)
! v  `+ m1 x9 c( F. k9 [% F4 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- u  ?0 }+ Y4 f8 |& [
        else wait for 10 sec
* D( g- ]# f7 O9 T; x! p        if A_i=A_leave then send to die  d5 ?0 Q- o1 k0 |7 t) f/ O; s7 H
        else inc A_i by 1
, u1 S# k/ y6 Q4 s    end
6 E' R' l2 n' A! _end4 _& f6 I5 W3 r+ @; p* {- }1 K2 e
$ d1 e$ Q" T. r( D6 p
其中的procindex为整形,代表当前process的序号。
: ^) p- c% ?9 B* R# C  Q: ~& 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-6-22 20:17 , Processed in 0.013895 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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