设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12774|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 {" C% L, V$ H6 |& I
0 R6 x+ ?: g3 I) K' I' G6 ?$ m我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& V0 W4 m5 @6 [
) O$ x5 `7 k2 @7 c8 c9 r7 dbegin P_read arriving0 l( e$ N) f3 E: Z$ T
    while 1=1 do begin
  l- X* F8 Z' w$ y# w5 H# o        read A_tote from "data.txt" with delimiter "\n"
9 \, z1 R" ?; [        read A_time from "data.txt" with delimiter "\n"
5 C1 x, l# O! V- C+ L$ j5 k        read A_leave from "data.txt" with delimiter "\n"5 V9 P; v3 p0 _$ w
        read A_picks from "data.txt" with delimiter "\n"  L  n7 d2 a8 K$ l# K8 e+ E
        set load type to A_tote
: \/ \6 E2 c, F9 {2 w        if A_tote="tote 1" then set A_induct to 1
" D2 s$ B0 m2 f        else if A_tote="tote 2" then set A_induct to 2% z# i: Q7 P% i4 Z( ^! i% z
            else set A_induct to 3   
& Q/ d) O# t; r" M% B        set A_i to 0
, i* g6 I4 Z4 ?- c: b: A        clone 1 load to P_induction+ m1 T- X1 d/ R; N" ]# o
        wait for A_time sec
- Y+ x+ c9 [  _6 J" I    end6 Y6 n( m! q% |4 @: ^
end' ~6 E, a! R; r5 S. ~3 x& D" v- z

% S5 Q) E/ h# \* t. G- ]begin P_induction arriving
" X' c5 {9 C$ @$ {9 f. K    if A_induct=1 then clone 1 load to P_pick1/ m0 q2 A1 C% j0 H
    else if A_induct=2 then clone 1 load to P_pick25 F1 }: O3 ]% r/ F! t
        else clone 1 load to P_pick3
( L8 q1 u. U; t3 J2 @( Kend
$ {- l; m3 W8 I4 Q& l; N/ k' V* ?, v/ {  ~' M. b! [. Y# [
begin P_pick1 arriving0 \- ~5 u" Y4 {! o
    set A_i to 13 Q  w! x+ A7 E: _7 O0 `% ~
    move into Q_induct1
4 K7 M7 {, V- O8 G0 c2 T    move into pickaisle.induct1$ @( E" X6 V# C& H+ T4 ]/ H) R
    while A_i<=30 do begin$ V) U8 x  X9 F0 a3 ~
        travel to pickaisle.con(A_i)
4 U. F9 V8 I6 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* \; o2 r7 U3 ~" H        else wait for 10 sec( z4 V9 d6 j0 w# I2 V
        if A_i=A_leave then send to die- y3 T8 c" M3 q; `: Y7 s: _
        else inc A_i by 1
; |6 P* Q' X. x+ e    end# T2 m5 c0 v' j
end
4 G- J) D- o- Y0 L$ a( b% p: a7 \, T- |  S$ |0 U8 M
begin P_pick2 arriving
3 ?) b6 @% a/ l4 W* D8 }  C    set A_i to 11
8 Q8 y4 g) ~9 W# u% m8 r9 s    move into Q_induct2
0 F9 ^3 I8 v. P3 y1 t5 s  S    move into pickaisle.induct23 Q3 b4 Y7 g; U6 y* @9 J
    while A_i<=30 do begin0 K0 z! t& `3 T0 ]7 Z1 C$ b
        travel to pickaisle.con(A_i)
2 s9 h, L: h$ N: j$ E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 c8 D# C/ a1 y# |2 f+ V& y$ c+ B
        else wait for 10 sec2 }* M8 b. d# `7 E$ b  V$ O
        if A_i=A_leave then send to die3 b$ }( A6 I# z' e$ I9 Z& u
        else inc A_i by 1
  y* @6 E" q( x    end
+ l1 _7 x0 U* {$ O/ B7 cend
& n6 F# B% r+ m5 Y, e$ M3 [4 V6 q8 h" p8 X( |4 p
begin P_pick3 arriving* K# e$ |2 a( Z: ^7 M
    set A_i to 21# K. F5 I; z1 k4 t. W
    move into Q_induct3
$ F/ l- }4 @, D% k& V, F4 @/ P8 }    move into pickaisle.induct3
# R( [8 u* s% A6 x- L) T2 x    while A_i<=30 do begin8 ~6 Z. F  M5 ]% c  ~5 V
        travel to pickaisle.con(A_i)/ q% [. I4 v8 W: E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ _: K+ t* {4 V% l  z        else wait for 10 sec- a7 G% @1 Z. [
        if A_i=A_leave then send to die2 \+ [+ s  c, m, `8 F; O% W/ f
        else inc A_i by 1
' N3 I. t$ D4 z$ R; J8 f    end/ Z" L6 t3 B1 r( \7 r8 V/ M1 i
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是个什么东东?4 `! Y5 s* x, c0 x8 b" l
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# D5 u. |/ D3 [$ K
, q7 ]# q& Q" v4 a  A' e: J. u# dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 X2 [2 ^  T7 ]
0 m! g' V8 g6 C另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- ^: j- m! `$ G& K: }+ K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ S% w0 F5 z1 ~* p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& P. Z" @: Z% G' d1 P/ \, i" W" N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" `, F3 {% r6 }9 E( N, o2 U* L
begin P_induction arriving( t" [/ K: u% X9 N  c' a
    clone 1 load to P_pick(A_induct); }7 E% e( ~. k1 p
end最大的系9 C7 d, W! W( ?) y
; L$ I! z2 {# ?
begin P_pick arriving3 j  S: Q6 V& s; u+ b. `6 A
    set A_i to procindex * 10 + 1" l5 Z9 Z8 {: a/ P$ {) B! m5 E$ k( C- y
    move into Q_induct(procindex)
' p1 c" P& M1 P( F& Q" L. ?" z    move into pickaisle.induct(procindex)! r2 O; [) H7 p
    /*check the type of pickaisle.induct(i), for your last problem.*/
& v( y. s2 G  e3 {# w, x- h. `0 r# k  R  s+ i6 w: b  M% v
    while A_i<=30 do begin' g3 F$ C; Y% d
        travel to pickaisle.con(A_i)
' U; k4 g$ N9 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 X, f1 Q5 P* N/ h; T. m! L        else wait for 10 sec
1 n0 ?) ~& A& G% D% B0 ~' y        if A_i=A_leave then send to die& b7 U/ v  B; X6 \' x2 D
        else inc A_i by 1* h5 o- p% q2 _( @% o6 M/ ?3 l, g. Z
    end0 W2 r0 i+ J% C, V
end
) K0 o( e: e# s9 y( F
) m/ ]. n  @$ S$ Q$ [7 g其中的procindex为整形,代表当前process的序号。8 B% K: i0 l& d0 @5 q2 r  D# a
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-2-19 11:30 , Processed in 0.015158 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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