设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15347|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. z7 F4 [! T' o' \* M: S* e( `2 q! ^& r
' f/ A/ K' {) Y( f* f, x  S* s
我的问题是,在每个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 {& R2 i, |( H0 L9 {9 @' w
begin P_read arriving+ W1 E; X9 a; x& S
    while 1=1 do begin# R2 \, x  \! k% R% w$ a
        read A_tote from "data.txt" with delimiter "\n") \" {5 z& R9 e+ O4 Q
        read A_time from "data.txt" with delimiter "\n"; q- k9 }7 W4 O0 P4 x
        read A_leave from "data.txt" with delimiter "\n"0 B) M0 B1 W% x$ S* u7 G. [4 j  m
        read A_picks from "data.txt" with delimiter "\n". M' f- ~; K0 L
        set load type to A_tote
7 r* v8 m- |* J        if A_tote="tote 1" then set A_induct to 1* s. s, I( ?& f! y% U
        else if A_tote="tote 2" then set A_induct to 2
4 `2 [& ~1 H( \7 H( m            else set A_induct to 3    " H6 Q$ Z; A/ W" s& {
        set A_i to 0
* o  H/ L* {: m- D# R  @. w        clone 1 load to P_induction
% ^6 T. m- P" D' Z4 T        wait for A_time sec0 `  S/ J* W. }# M) C  O6 j9 S3 K
    end: [7 {* ?" m0 H
end
  Q' d, `( [% O6 X4 m! r9 P
' Y- Z! X( L' W& \. f) G* J: xbegin P_induction arriving3 }4 l/ W- L, p4 X: M. M
    if A_induct=1 then clone 1 load to P_pick1
# m% ~$ k6 |6 `9 d4 {, [    else if A_induct=2 then clone 1 load to P_pick2
( ?/ b( U" K8 A5 P        else clone 1 load to P_pick31 n9 f* X6 X! F  p0 T) J9 ^; I
end0 V! D5 M1 q! I+ D. ^3 D* q$ |
$ ^5 f  _+ B$ ?' {  s) O
begin P_pick1 arriving" A# L$ ^! C8 D# n
    set A_i to 1% y% d8 |- l, T; ]+ W
    move into Q_induct12 _  M0 f3 ^: ^+ }" E% B' `
    move into pickaisle.induct1# j6 v% z: C5 B8 a. F( ]8 T" R
    while A_i<=30 do begin- T2 M8 S" L# p
        travel to pickaisle.con(A_i)8 H7 S3 _* P* r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 g% f% N# U7 v
        else wait for 10 sec5 |6 f" X* p, C- Y) U
        if A_i=A_leave then send to die
; D6 C9 j, h5 k% [6 `0 {2 D        else inc A_i by 1
6 l2 b. P" _4 [; X    end
0 e2 P  l: J* O) u; ^end5 R& V# M0 `5 p5 e/ f
: J* B" V2 _! j: f
begin P_pick2 arriving& B: i! h5 @) Z; u& m" ?
    set A_i to 113 V* H$ c- }( a. m4 f
    move into Q_induct20 P& N- n4 o5 h1 O5 q8 x' R+ {7 ^
    move into pickaisle.induct29 C; s; h6 v+ ?# `5 z
    while A_i<=30 do begin
, q/ `- C9 g& C% S. a& X: Z( r0 T        travel to pickaisle.con(A_i), S  f% i* w$ y. o# v! F2 A$ m. i9 C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* \+ ?# N5 J/ ?
        else wait for 10 sec4 Z" n" o+ t5 _: s2 K, z& Q
        if A_i=A_leave then send to die
2 f# y* m- r% ?5 m, E        else inc A_i by 19 g! R4 p7 c9 {5 E( {2 p
    end$ Q: Y; z- M3 {$ K( t8 }
end: b' N2 e. Z1 T, k' A' I0 X: h, a

3 D; \5 t5 I- d/ c8 S% @begin P_pick3 arriving* }' l1 N  h8 z  z* ~! O6 o
    set A_i to 21
  Y& d  S9 @% T6 Q& f) ^# @2 J/ m    move into Q_induct3  P* W: S! ~: G: t4 Z* S
    move into pickaisle.induct3
- }3 Q' @2 m( A( [/ I5 H9 i1 o    while A_i<=30 do begin
% {0 \3 r& f3 |  N: A9 `' V        travel to pickaisle.con(A_i)5 B6 D! W- R; W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* o( Y% ^2 q! g) U* v3 ^        else wait for 10 sec
8 {! t# w) u- q+ Q' d/ c        if A_i=A_leave then send to die- N& r9 S" ~7 G
        else inc A_i by 1
6 C8 O( g4 p! M7 ?- u    end
- a9 ?- U# t' z5 o; Eend

最佳答案

查看完整内容

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是个什么东东?
3 J$ D: s7 n6 P& Z7 p0 C# cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  u6 z% S8 X6 \$ A# e' G" C; \
* k; u5 |' }. n. ]$ B4 A) iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& q) {; U1 _+ s8 P" H0 X. H1 g5 a" |: ?& s3 c* S% P$ Q
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
% a) m3 F+ M0 u- ~+ L1 x1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% b, K0 w+ i) u
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 J5 K, s  j% X* r% \
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; ?% D" y  ?8 S: z8 N5 {
begin P_induction arriving7 I% F5 z$ }5 _( w0 l( @8 B
    clone 1 load to P_pick(A_induct)$ P% F! s/ t6 {7 Y- _- b
end最大的系: p- U) E6 V& F1 M$ R

8 s0 \7 b) d: t8 {' _begin P_pick arriving/ R, q& y6 H+ F
    set A_i to procindex * 10 + 1; j' i) N# K$ w" C5 B' K
    move into Q_induct(procindex)
. q8 H  {* F8 X3 z5 t0 G    move into pickaisle.induct(procindex)/ F) `. m5 h' k) i& F( B
    /*check the type of pickaisle.induct(i), for your last problem.*/
: m" r& ?3 r+ r( G: X0 ]" v; ]% _$ [. S
    while A_i<=30 do begin
( N6 _- x, V6 P2 g* J! j        travel to pickaisle.con(A_i)
! c% _* N  f+ q9 y& o5 f' X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! c$ K! T1 n& q4 g" J: B- \
        else wait for 10 sec
( E; h- H. Q6 x  \0 ^/ i        if A_i=A_leave then send to die
" }  ^/ K1 M+ c5 ?" F        else inc A_i by 1
6 h% t% g& o0 @    end+ H' m, L  S* m  o9 y! Z( C$ m2 l
end
( g! \: {" k) T! S+ p
/ j1 h7 c" H0 ^' u1 w其中的procindex为整形,代表当前process的序号。- S7 Y/ S6 S6 s, 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-9-4 01:15 , Processed in 0.017057 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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