设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15380|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 A+ L8 N; _6 d( g, w% A
% @1 I$ |) G3 z8 Z/ q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' K( a/ c( h4 n7 ^
1 K5 I& y& @3 r9 j, T+ e' l6 Sbegin P_read arriving
: Q9 a6 \- R% U. d    while 1=1 do begin
0 y  K* T/ E* s/ f6 p' D# n0 P        read A_tote from "data.txt" with delimiter "\n"# p( l1 i* |% t) I* j8 x% F2 f
        read A_time from "data.txt" with delimiter "\n"
- q: M3 Y6 L, Q2 y7 t6 }. b        read A_leave from "data.txt" with delimiter "\n") U3 X3 x+ o1 r' I2 `7 ]0 Z8 D
        read A_picks from "data.txt" with delimiter "\n"! e  V( I2 `' Q) W; T; C& }
        set load type to A_tote
4 F9 X  s7 v7 X1 u; j4 O, E, O        if A_tote="tote 1" then set A_induct to 1, X+ C# ]4 H* J8 D3 H* c
        else if A_tote="tote 2" then set A_induct to 2
! a; x; J5 ?3 L' M$ i' O3 a2 y            else set A_induct to 3    3 n8 f% h( ^. S3 N. |; B. @
        set A_i to 07 m( j& p* k! J
        clone 1 load to P_induction# u" V. k2 B" a6 M
        wait for A_time sec8 g4 p* F$ R% F
    end. [. Z* o% J3 Y3 L
end
! w, U/ ?& L9 k  l1 m3 ?
  I  L2 Z( \* }) t0 Fbegin P_induction arriving
; }" V4 [- T0 K1 J    if A_induct=1 then clone 1 load to P_pick1
9 `- n# k$ G, |: @1 _* y7 r1 K3 K, Z    else if A_induct=2 then clone 1 load to P_pick2
2 L5 b" n3 @8 w* v1 x        else clone 1 load to P_pick3$ D9 i  I3 A$ e  w. C
end
  _8 |+ s* T0 r) B7 Z+ T$ _6 S' A$ n% y& U6 t% s, k
begin P_pick1 arriving6 u' i: T, O% h' t
    set A_i to 1
7 A. I" B/ y; z' o5 v* |    move into Q_induct1, A, S7 F* A) f: b- ^; S' ~4 q
    move into pickaisle.induct1
, `" t- V& U  Z1 |- B2 _2 B    while A_i<=30 do begin
0 y3 F/ U  \& o( V- k$ W; f        travel to pickaisle.con(A_i)7 H: y/ \) H1 N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* }# y3 j7 p' q0 p, r% h
        else wait for 10 sec
4 @$ e8 t/ C. A+ w        if A_i=A_leave then send to die
! g. X* t/ ?+ A# Y        else inc A_i by 1
4 N# v& d/ d1 x! h    end
# K' b9 D, {8 H  U% X4 Y, z* P- ?/ Oend
3 W/ _1 s% F# E4 G
4 g9 r* h" @- Ebegin P_pick2 arriving2 Z- N* g  S! c8 ?! ~: a6 o* W6 a
    set A_i to 119 R* I* A) T) }2 `4 k; W9 H
    move into Q_induct2
" i! h8 h" W& b) R& O. ]    move into pickaisle.induct2
9 G" F2 U8 o' U2 m: o8 M) Z    while A_i<=30 do begin$ E. C5 x9 z$ z' i
        travel to pickaisle.con(A_i), p, a7 g: P% |9 r' d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, ?" u. D3 W0 z7 ^8 R4 q6 B( k0 X        else wait for 10 sec( t+ N) D6 F/ n) l
        if A_i=A_leave then send to die
* l' H4 L9 G% ^! E        else inc A_i by 1
, [2 Z, t; i/ I0 h( x, T    end
8 I6 }# I6 `5 W9 ?9 z4 tend6 Q: p3 b& h" m  z4 a
) }6 h9 J& n1 c) C$ D
begin P_pick3 arriving+ |- i& ]5 }  V9 y8 X8 y& E
    set A_i to 21
% ?2 a# e: N2 f- r( S    move into Q_induct36 g7 V4 U9 }7 V% y+ U  q
    move into pickaisle.induct3. i: ^# Q( @: B0 {6 l
    while A_i<=30 do begin
. c. f3 T3 E$ H        travel to pickaisle.con(A_i)
! C  Y8 ^1 n" G9 A; |5 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 W6 P9 U) ]5 A' z. h* H
        else wait for 10 sec
$ y( q0 H% |# {        if A_i=A_leave then send to die
/ `" A! ^* F' W3 Y3 E$ D! P1 [3 D        else inc A_i by 14 n- B0 f+ h$ k! z
    end/ ~+ {  C9 H" @: W* V
end

最佳答案

查看完整内容

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是个什么东东?
8 n! J+ H0 S- F: i- Jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! }2 G; n3 |( ]1 _4 [
( [6 `* T5 e) j3 }
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 ^0 @9 @2 \- x9 F- ~
" ?  z* J' n. r% K
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  J' ^% ]8 w; Y& o& c& s5 \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  j) q6 }1 P8 X
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;2 c/ Z9 J3 R3 E. R/ _2 O2 l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 W, ~! G( q3 t$ F; k. vbegin P_induction arriving
' `- F  d: A% |% F1 G' A    clone 1 load to P_pick(A_induct)- d$ U" M: E3 e  ^1 t$ T5 B
end最大的系
: p' }, K( G# X- F4 @1 B9 c# R% o7 Q' D! N+ C! z# g
begin P_pick arriving: p! i0 y8 w0 B
    set A_i to procindex * 10 + 1
1 c6 d& ^9 ?+ E) L& ~7 m8 M# m    move into Q_induct(procindex)
5 U* v4 i7 f0 P    move into pickaisle.induct(procindex)% y. @# Q& I1 ?  x( \7 y
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 }) {3 g& U5 l# i/ r4 M4 L4 T2 i6 i, k3 G3 ^* s6 i
    while A_i<=30 do begin
- Q9 i& J7 J0 j, n* O& z. ]' u        travel to pickaisle.con(A_i)
2 t$ |! e5 M9 `! e, l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 _  Z% q. |" u6 r! Z
        else wait for 10 sec
8 Q6 ~. z/ s7 s- H' ^        if A_i=A_leave then send to die0 H6 m2 B' s8 y: o+ E' f
        else inc A_i by 1
1 f; m6 p% y+ z9 Q; S: ^: E    end& S( U- g* y$ V  g
end7 H8 `7 d8 e" S6 m) j
: H# W7 g# k- C5 l6 U. Y
其中的procindex为整形,代表当前process的序号。
, z' a8 o9 ~# vstation和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-7 13:41 , Processed in 0.017234 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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