设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15149|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( Z2 W: I5 Q9 e& o
5 a9 r2 s2 n; P& H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" |) A4 u* I( f3 A5 ]( E! [( c
7 g+ c3 M- m6 C
begin P_read arriving
6 N1 p! `1 f, i9 i$ W7 b; a    while 1=1 do begin
" L! V* R* A' T$ A        read A_tote from "data.txt" with delimiter "\n") _3 h/ U, N% O' b
        read A_time from "data.txt" with delimiter "\n"# X0 v4 M9 ~6 i/ n
        read A_leave from "data.txt" with delimiter "\n"' g1 d/ C6 t+ j  s. {1 c# M/ ~
        read A_picks from "data.txt" with delimiter "\n". Z4 O* `+ q: v9 i: |- r
        set load type to A_tote3 q, ?$ ^8 U; `( @$ I/ f, M
        if A_tote="tote 1" then set A_induct to 1# M/ l5 W- w8 @5 y
        else if A_tote="tote 2" then set A_induct to 2
0 s' p2 l# ~7 r6 e7 R            else set A_induct to 3    4 ]$ M& |# E  m7 E) j
        set A_i to 06 f  U& {8 C8 O* ]5 j0 h: |
        clone 1 load to P_induction
- _1 v  s' ~# n2 V! U- G        wait for A_time sec" e- O7 z" c+ w, ~- \1 A2 V
    end
9 b$ M6 Q: }' Y1 K. E$ k: Send
9 K7 J2 q& V" ?6 |. r- A5 |
8 s6 ^7 e. L8 ]$ \begin P_induction arriving5 y% `; \( X7 k$ k, [1 w4 ]
    if A_induct=1 then clone 1 load to P_pick1
; M* O' p) x: R8 P' P* p  l    else if A_induct=2 then clone 1 load to P_pick2
5 l, u0 w2 |2 B3 g( J0 N+ ~        else clone 1 load to P_pick3
' S% [: w" S" \end
( H9 t- q) L7 ~# S% j& O, T8 M9 C3 u; G5 V0 C
begin P_pick1 arriving
/ E/ E* d" ^7 q; W9 U    set A_i to 1. d) s# C% i! v; y$ Q
    move into Q_induct1
) Y. w8 s, c% U9 G! q3 }    move into pickaisle.induct1. z# R" O1 K, O( T- R, D) b
    while A_i<=30 do begin6 D: Z% I$ @4 Q) d$ `  u
        travel to pickaisle.con(A_i)
0 S2 h1 ~  Y2 `8 o1 U        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& A1 Z4 Y& H. S4 j& Y        else wait for 10 sec
, r, w( b) w! A4 z  h        if A_i=A_leave then send to die% F- _0 |" }; L' ~" T/ f5 r
        else inc A_i by 1& {' W& {6 N1 R6 ]
    end
4 F( k- m4 X( r  G  m) Mend3 r  \+ O  j( u& n5 g5 u4 e
" q( f3 e6 Z, y4 Q0 ]9 ?
begin P_pick2 arriving
- ?2 z( Y" H, x( t    set A_i to 114 |$ U; S, S0 y
    move into Q_induct25 N7 }5 ?9 i, I) w. T' u
    move into pickaisle.induct2+ g5 L- e4 G5 n. m# j  M6 B* r& A
    while A_i<=30 do begin$ Z; q8 m6 Q$ u  }2 V
        travel to pickaisle.con(A_i)5 z3 W5 l# T$ T, C8 a$ F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& ^3 I8 L; @& t; O7 x6 C
        else wait for 10 sec
+ x  T  {# Q& m        if A_i=A_leave then send to die
0 ~" r8 h( M% v1 |        else inc A_i by 1
4 r& I* t( a3 n% D. c    end" e: C1 p: j# Q5 u; Y
end
6 E! s( P7 `; c4 t0 V% O4 h. Y3 d4 }! n# }; n& G4 I( ?- m
begin P_pick3 arriving
* }0 T; q4 d/ N5 i    set A_i to 21
2 P* O8 v; J) X- G$ g    move into Q_induct3, T' g5 w& \" b1 m. u9 y
    move into pickaisle.induct3
2 O( E9 t' g; l; D5 Q    while A_i<=30 do begin
0 M/ w* E. F6 L% R2 r5 |/ B        travel to pickaisle.con(A_i)
. Q; G/ x5 Y! @4 f0 `; X4 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 T  V6 v: G- o' L8 h0 @        else wait for 10 sec
( m$ c9 d" k- |5 H        if A_i=A_leave then send to die
; e  b& l' x* @- O/ E        else inc A_i by 1
* v! U$ n" v3 [1 x    end
5 B7 W3 @5 l6 N3 N% Kend

最佳答案

查看完整内容

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 ?7 H) i* J$ o" X
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 v8 M& I+ g# [, _4 d2 D1 X/ }+ H0 n: F" \4 ~
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: d4 {, a. v5 v
, D: M- s* a  x( Z7 r, v6 n+ l另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( j: }1 B1 n/ C" Q1 }, w( g
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 v0 @1 G( S+ g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;$ l8 N0 D& }7 Z! \8 C6 a% _4 R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
* [4 ^: J) ?* o; N( fbegin P_induction arriving
: q7 _, c6 y5 k9 w    clone 1 load to P_pick(A_induct)) d% R& `' `& s* n  Q& F
end最大的系
% E1 y& n+ j" |5 ?2 D
" U( g' A/ K: }( |2 Z, ybegin P_pick arriving  B! X+ ^$ R7 J! }
    set A_i to procindex * 10 + 1
8 ~. S: h+ n& O4 W$ f. e; \    move into Q_induct(procindex)
9 K& h4 ?; a+ n) }% U3 G    move into pickaisle.induct(procindex)# G5 O; y0 _# Z9 e6 V
    /*check the type of pickaisle.induct(i), for your last problem.*/
# r5 Q4 w& X0 |* U1 H$ K* I% C
$ e( Y9 c9 I# l) i: d; ?    while A_i<=30 do begin
) v; f6 C: y% A5 z* }5 j& ~        travel to pickaisle.con(A_i)2 b5 [% R! m4 f: k0 V  N1 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# J- X" b! a3 v2 K' x: X" O+ O: ]
        else wait for 10 sec4 ]. L7 U: q. T& t
        if A_i=A_leave then send to die# @( h2 p5 s1 G! T% O* T
        else inc A_i by 1
3 |0 ^/ ^# K# ?; D    end9 L! D# `  e6 f$ M
end
! O: a% N7 d  P' n2 Z
7 w+ L4 p3 b' P& H, i9 l其中的procindex为整形,代表当前process的序号。
  B/ F& Z6 K  A+ T$ 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-8-15 16:15 , Processed in 0.014179 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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