设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13360|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 Z/ e, i; R0 Z' U) c% j- l* U) \# t: b* |7 y3 e& x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 \# Q: i- z; x7 w& U  i

. t0 J& M' p2 z0 A. H' k7 L+ v6 wbegin P_read arriving
9 Y6 O5 S2 k+ G2 E( i    while 1=1 do begin9 X' o; L. ]+ G7 V$ Q! _
        read A_tote from "data.txt" with delimiter "\n"$ G2 A$ f/ l' I) h& W: j
        read A_time from "data.txt" with delimiter "\n"" v! }+ I! x% V4 z7 `
        read A_leave from "data.txt" with delimiter "\n"
- n& r& M4 {$ h. {; I        read A_picks from "data.txt" with delimiter "\n"
% K+ T6 T- X+ g        set load type to A_tote
- \7 ]5 S4 i9 D) l5 B& C% A$ `% R) l        if A_tote="tote 1" then set A_induct to 1; p* _. \8 }. f
        else if A_tote="tote 2" then set A_induct to 2" u0 @: ~: X9 X/ t
            else set A_induct to 3   
# @4 w  w# ?/ |' K. i        set A_i to 0: d3 t& ~, x1 V+ \( z- ]; E
        clone 1 load to P_induction
& r( i4 N- B0 e1 T5 I7 j' ~# K" }        wait for A_time sec- f: x% P% F+ Z/ f5 @% m; K
    end
8 r& T1 e  K- p3 M1 Rend
$ o/ q$ D" K( ?! E) l
& F& ~. _5 j2 j" H5 y5 A& kbegin P_induction arriving/ _; c$ u! [/ F9 t9 C4 f+ j
    if A_induct=1 then clone 1 load to P_pick1; y: `5 q5 t6 q! T* S
    else if A_induct=2 then clone 1 load to P_pick2' k$ t- i3 q3 G: x0 y. H; j( Z
        else clone 1 load to P_pick31 S, v, p9 w8 B; o( E  b% j- D
end
- ~+ F, I" z' E* t5 W# ~
0 a2 P) {" d( n; Ubegin P_pick1 arriving
7 Y4 i$ t2 X# f+ J8 W% [9 C    set A_i to 1
, m# {- x9 E4 G% |    move into Q_induct1
8 z1 @5 v* |2 F; p" u- S% L    move into pickaisle.induct1% Y: B/ h0 o6 F! |
    while A_i<=30 do begin. w5 t' u  @3 I# [% _" Q% Y
        travel to pickaisle.con(A_i)' N) _( ^6 f$ V/ d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 x' u7 K( u. \) |4 F* g0 C        else wait for 10 sec
: Q! ~/ J8 S) r  D7 Z+ t        if A_i=A_leave then send to die
0 P/ T' w- U+ K* v0 s5 |% {        else inc A_i by 1. d3 _$ o7 Y: q& B& q
    end
2 C/ a% F9 d# j( n8 X5 l# T: oend, s& n0 P& c4 X0 j

8 z# P* r7 S9 @, ?begin P_pick2 arriving7 S! f  w9 ~. G( b) v' [
    set A_i to 110 B% O$ ?  g) \
    move into Q_induct2
% `2 X9 d( D# W. D. p    move into pickaisle.induct2  h9 G6 j- w( H8 |6 u
    while A_i<=30 do begin( {3 s! B9 j( r2 V, E' I7 E* f+ k
        travel to pickaisle.con(A_i)6 Z+ F6 n7 u. V4 w) h4 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 L7 o; r3 O2 z9 S
        else wait for 10 sec
* _$ i9 C( M7 p3 P5 L3 Y# w        if A_i=A_leave then send to die
( A1 c$ j& K) \  X2 z# D        else inc A_i by 1$ t+ L3 [/ F$ }6 ^1 }$ e
    end' q: {' Y5 k0 z, ^9 \
end& n! p. F9 l2 H; G* Y
4 _" V: k) a2 T0 S+ i- ]
begin P_pick3 arriving, j; h+ _" d3 F' y% N. k
    set A_i to 21! r0 z7 w0 P2 n5 G' Y8 J' f/ Q
    move into Q_induct36 l, ^( c6 I  e4 p4 }" t. E' A
    move into pickaisle.induct3
# `' N# K$ d5 c3 H# |% q7 r/ J    while A_i<=30 do begin! g0 E( e% B$ o% x8 D
        travel to pickaisle.con(A_i)
2 B2 F2 G! t( k; g# m, g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  B3 [% `; u$ @) Z) X) @! J& n7 \        else wait for 10 sec
+ f/ s4 k* t# G3 L        if A_i=A_leave then send to die4 \' x* t/ }' \" r! I
        else inc A_i by 15 p5 U* O$ J6 _- s7 d
    end. g+ q' R* o" X% {( x' i1 C
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 z5 V2 y( o* e2 f3 W% F; Xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) B) I) `/ _: S$ L4 _! y  a  _3 Z" ?, }2 h
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( }+ Q- f5 t, \% f% N; z! B; O3 {1 N* l" q
$ C! c0 e& X) P5 o- |9 f另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. H) M  W9 C4 [2 J
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 d3 ]0 \0 T# J1 x& h, O- W2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! A0 i3 R3 A+ J: n) T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ h* v, l$ V4 b+ q! Ebegin P_induction arriving) X( J/ ^: t1 [6 k: A' ]. u+ b# b& k
    clone 1 load to P_pick(A_induct)% S' N" B$ V( ~+ Z4 h8 e
end最大的系
# z1 y" _- I# `5 F6 o  W, \
  L; B8 Q% U' Q" tbegin P_pick arriving
- _/ r0 {# [: f& ~/ F/ r1 A' @) |    set A_i to procindex * 10 + 1
" b3 q$ w" A2 `1 N6 |. C    move into Q_induct(procindex)/ H" o4 b  H& X/ z, o
    move into pickaisle.induct(procindex)( R+ ~: k' s$ E' w% N
    /*check the type of pickaisle.induct(i), for your last problem.*/) h% o0 `! Z, y  J

5 _, K7 u# |0 U6 t    while A_i<=30 do begin& b; \# c, K. ?; X  I
        travel to pickaisle.con(A_i)
% y2 q: Z! a$ j( v& F  a6 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, H+ y0 X' P2 C        else wait for 10 sec
1 d. x' Z1 @" Z0 _; F& ^        if A_i=A_leave then send to die# l# e0 ]& j3 ^. K" w% j
        else inc A_i by 1
; N  Y$ d. n( J4 c" R    end
0 _6 o3 s# e5 l) T0 }end. ^/ r) e2 \9 ?) \. X6 K
$ f" d, T9 Y4 s7 X5 K4 G1 a1 \, v& `
其中的procindex为整形,代表当前process的序号。
& p) U9 t" S% _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-4-6 19:26 , Processed in 0.021845 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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