设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14469|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 D3 k" c" `4 M( H; _
( D1 w* x$ g' x- r& D; O8 b我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" \, T! ?  c( u4 C3 `' w7 Y+ [
) J& i4 G/ [8 i4 X& Zbegin P_read arriving# a9 t, }, Y% i  w& z: g
    while 1=1 do begin" ~( M) N# e4 R! f! ?
        read A_tote from "data.txt" with delimiter "\n"
" ^& a) _! @7 v        read A_time from "data.txt" with delimiter "\n"& e' x$ g6 T. a/ f& i2 ]
        read A_leave from "data.txt" with delimiter "\n"9 q& y( ?7 |$ G6 [# u, U) p% W
        read A_picks from "data.txt" with delimiter "\n"3 L% d7 e! Z% x1 n5 J$ n: {
        set load type to A_tote
2 @0 n1 {2 ]/ L. B$ t& p        if A_tote="tote 1" then set A_induct to 1
7 ~+ A' K3 I) v        else if A_tote="tote 2" then set A_induct to 2) Y/ _2 O# F+ {( \: I9 y
            else set A_induct to 3    ! _/ V$ d2 _( a8 o% }5 `
        set A_i to 06 a5 @8 x( [& }; Z# ^5 Y
        clone 1 load to P_induction. U- I/ i( J7 U' u  m( G. z
        wait for A_time sec9 j) O, ~: H& `7 \! T7 y8 e7 a
    end# E7 ?7 ~; k  H- h
end
% I1 e; x1 Q' V/ |4 I3 b0 C
9 x. c. S. I+ T7 Gbegin P_induction arriving9 w# K% M8 c. O1 A2 @
    if A_induct=1 then clone 1 load to P_pick17 D, u* |; a: k  G0 p4 q$ y
    else if A_induct=2 then clone 1 load to P_pick23 K1 {& b9 Q! ^9 v0 i
        else clone 1 load to P_pick3
  D' a1 e! w; S5 Y# |4 w( Dend5 [$ z0 v! ?& y7 x) i

, ~' B6 h" }* t) nbegin P_pick1 arriving
% ~8 k$ ]9 n5 L7 X: Q) _    set A_i to 12 ]/ p3 S& @8 b) q- U( M
    move into Q_induct1' ^) C, L- @/ Y8 _9 u/ e# H
    move into pickaisle.induct1, J) X! |& R8 s0 g! f
    while A_i<=30 do begin
: O% b; j1 J! N* \; l# `        travel to pickaisle.con(A_i)) `( j  e, }4 |( w* [4 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) K% L% x# Y4 q9 o* b        else wait for 10 sec
5 X# }; g/ f8 w  e" z        if A_i=A_leave then send to die
8 Q6 m6 w* V8 W        else inc A_i by 1
2 r4 Z+ C- G% W# ]6 d* K% @    end
1 Y' Z$ C% [& b5 Pend9 Y) `8 [) F, m: Z+ [8 v. I

6 r% {8 N7 |7 G# bbegin P_pick2 arriving
: I9 U$ H& }1 ~* @3 M- C    set A_i to 11
+ H3 r. M/ l! N5 \+ r. Q( [0 ~4 N  T0 L6 h    move into Q_induct25 X. U3 u! c; _7 [! l; O" x/ n
    move into pickaisle.induct2; {1 k( H% Y8 |' I  M6 r5 M
    while A_i<=30 do begin
9 y; v0 S" k) B5 l. c' L( c        travel to pickaisle.con(A_i)
$ m( g' v; J( Q% M1 O; s+ m& c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 Y( |0 ~7 E) p& i  ]# r( N        else wait for 10 sec  j6 F( K3 j  O3 U0 {4 o6 t; K3 x
        if A_i=A_leave then send to die
/ C  f) g" q! R( S6 k; A        else inc A_i by 1" K# I7 R" f" K1 Y7 U5 U
    end
- N, n; Q. Z8 fend* e9 g) m7 M8 [; o
! Z$ V: H' j5 k4 i1 T' K
begin P_pick3 arriving
! q/ X' \  m9 A: {    set A_i to 21  N1 u2 c6 |# @
    move into Q_induct3
1 G) B2 {2 b5 y% b" z- G) i% A0 c7 @    move into pickaisle.induct3
& P7 P% n& F& c0 o7 Z, J    while A_i<=30 do begin" ?* o- p$ \% B/ T1 C
        travel to pickaisle.con(A_i)
5 X4 P) }% S' J8 W' |0 @1 k. ]' }: g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 e+ H$ \' ^4 Z, A( J        else wait for 10 sec
. F* {$ g6 j9 z( k0 [9 D! c        if A_i=A_leave then send to die
$ D4 E% H4 i1 b! [. M        else inc A_i by 1
9 I2 x/ c3 \( B    end
8 F+ V/ Q9 ?, G2 H# I8 Uend

最佳答案

查看完整内容

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是个什么东东?
: U$ Q3 H$ c, Tmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% u3 u& y( X$ s2 m" a9 N$ s0 a6 V* w7 v6 |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。' l# L6 d; d# C. E
; T7 y/ c5 K' A. }2 a; v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ N/ |+ m4 e- O( z
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 u& V: t0 C1 G1 s. G; {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' s) f( Z5 L0 B  t& g+ I0 S3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) {4 }/ c9 H7 W% r. g
begin P_induction arriving/ @) k4 Z; X% P) J* R6 p8 [- ]
    clone 1 load to P_pick(A_induct)5 w% H; _) |. k" k9 n1 t
end最大的系
) q, H/ {4 b# ]* e6 N
! S% J3 d: U$ D0 bbegin P_pick arriving
. A6 I, g8 d, \2 q/ K6 T    set A_i to procindex * 10 + 1/ P9 C; d& R* X# I6 U& \
    move into Q_induct(procindex)
- _6 s' b# x/ ^2 k# U    move into pickaisle.induct(procindex)
9 c' F. Q2 O' [: s# A1 H    /*check the type of pickaisle.induct(i), for your last problem.*/
4 k9 b) [$ J+ B1 ]& y' ~6 g! o% D4 \' Y
7 H- N' I* v& \( H2 }    while A_i<=30 do begin# Z" V; j  A/ _, j# K6 [
        travel to pickaisle.con(A_i)
; ^; n# g0 d- x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- V# Q. }; R" C9 W& C
        else wait for 10 sec! T5 ]3 Y2 ?" y' E* L, Y4 ~
        if A_i=A_leave then send to die
3 L' y6 H" j- n  c        else inc A_i by 1
6 g) i- Q% v5 Y3 w    end
& _' f4 C) P2 b  Q* g* Cend, n- M: l& V( O
2 t2 ^+ X1 s$ e/ K
其中的procindex为整形,代表当前process的序号。
; j0 c, q! R2 W. {% z7 C$ r# ]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-13 20:02 , Processed in 0.017000 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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