设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14138|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' h' n" A- G  W9 h

& W5 p9 n0 O7 N( 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中的数值,不知道会不会有什么不妥。5 s! H! p: R* G: B
7 |" l2 M; I: B0 @3 i* h5 R! A/ L, e
begin P_read arriving) D1 E* Z) p+ ]
    while 1=1 do begin* I6 }0 `* P+ O5 X& a' p3 U" `
        read A_tote from "data.txt" with delimiter "\n"0 D% c' _4 b: h* U( Z; U# b4 f
        read A_time from "data.txt" with delimiter "\n") @: s$ j' v% v% x! D9 H9 k
        read A_leave from "data.txt" with delimiter "\n"9 X  Z3 u: T) P: a
        read A_picks from "data.txt" with delimiter "\n") X, e. D8 N* o5 ~' I8 Y
        set load type to A_tote# J/ n! j6 y) s1 D7 ~0 o: e9 u2 m1 C
        if A_tote="tote 1" then set A_induct to 1
* ]) h/ |3 `2 I) u2 r8 \8 X8 _        else if A_tote="tote 2" then set A_induct to 2
' H) s& F  {# a: o- b+ g; H1 R' E            else set A_induct to 3   
. z* R- `  h  {5 R# a        set A_i to 0
& \' i' J% V9 {! C2 R        clone 1 load to P_induction
6 _" L) R4 E; Z6 I& C$ W        wait for A_time sec, ]4 ]4 m( S% D8 H/ X) [
    end
( ]* b& o: d2 O" I0 }4 V% H( c1 P3 iend6 z  D, c4 G! d8 k

3 F7 D( j7 F$ a6 _( Lbegin P_induction arriving3 l3 `, A+ Z$ z, v0 m
    if A_induct=1 then clone 1 load to P_pick1
# |8 l7 x6 i  ~% j* m% q5 D    else if A_induct=2 then clone 1 load to P_pick23 s6 y" y2 _8 N3 D0 i0 l3 n
        else clone 1 load to P_pick36 x$ [4 T. v3 S3 f3 @. u
end9 h3 O4 P7 q( c; A" @

6 {: R+ K( {9 U: C, B- ?begin P_pick1 arriving8 H5 a* y* r: j" Y
    set A_i to 1
# \4 B" l1 z. d' N7 }% N; B4 M8 E    move into Q_induct1
" Q, S, V$ H, g( J& J* z+ C$ Y    move into pickaisle.induct1
6 l' n* r1 b2 a" ?# d2 ?    while A_i<=30 do begin1 j. ?/ {  C, o' C% E0 I
        travel to pickaisle.con(A_i)
9 f5 J# `2 k) j$ J  Z' A7 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 d0 p, D$ q+ Q1 S; d
        else wait for 10 sec( E& h* X0 p0 o8 E" Q
        if A_i=A_leave then send to die
: q3 J# }0 u& r        else inc A_i by 1! p# C' k  I  x: |% k  k
    end' c/ Q6 T+ R" c* _4 H1 C1 G
end/ E' k1 }- p$ D0 f2 ~
1 h4 b+ x' E6 Y
begin P_pick2 arriving$ D, l/ Z6 }  x' m2 @
    set A_i to 115 m& x: f0 q) X' h$ {9 Q* ?
    move into Q_induct2
: l; ?  N! B( w# k- ^% l    move into pickaisle.induct2
# {7 z/ i/ p! g# v* i, U    while A_i<=30 do begin
$ ~7 B. L! i0 r% v        travel to pickaisle.con(A_i)
6 N# o9 K: i* E7 D0 A% z2 @% j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 K) [8 q5 D' O  {* x- W4 A
        else wait for 10 sec, ~" ]" D6 P% t5 ]
        if A_i=A_leave then send to die  j: F& \% r3 Q7 F5 x% l: u
        else inc A_i by 1
! A: m; {# t2 f, V    end
- o9 U* t/ d5 K) _5 K2 M" ^end" E+ A( A- B- Y7 o* u
- q: J9 s0 w" X3 i! U
begin P_pick3 arriving
& \0 z$ h7 `: n1 g- n+ r    set A_i to 21
! J! a6 S; K1 r7 ?% W' I8 K    move into Q_induct3$ w8 ]! N7 {9 j) L
    move into pickaisle.induct3
( o+ S1 D/ \+ _) A8 g; O% m    while A_i<=30 do begin
7 _* C2 A4 T7 i2 i. K# B# M% G        travel to pickaisle.con(A_i)
# V; ]% f+ i6 E) R0 u+ o5 Z7 v- ], d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  g. k0 c+ C: x) A6 s- K6 g2 Z1 I        else wait for 10 sec
5 I9 s) S1 O8 H4 t        if A_i=A_leave then send to die4 @- H% J& L5 x+ ~- u" v( ?0 h
        else inc A_i by 1
' k3 X& f4 h; K+ f3 m    end) |+ `8 E, y/ I- l8 l6 t8 o5 w
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是个什么东东?
& @1 x0 x' C3 ^) U1 j" }7 G6 Q$ nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' u9 i4 _1 k1 G; L) S, R4 G$ J. H9 _) ~3 i) n7 n( x" r
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 s- i0 ~! R4 y- f
" e7 ?. ], i* e/ X另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ p+ Z; i1 I7 |8 T4 _- _& h/ O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;, R" P7 e  N: N) a2 c
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
* F2 p$ v* c3 T! D7 p$ x3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
  W, i) ?2 i; f% Dbegin P_induction arriving+ x1 y3 c* T$ |1 L# a
    clone 1 load to P_pick(A_induct)# q, I" k, U0 O
end最大的系
8 p0 k8 ?! a0 }# U) l/ w4 i' f
0 u- u. _  B1 }9 _, O' N6 _- @begin P_pick arriving8 f9 A& p7 [; Q* J  ^; N
    set A_i to procindex * 10 + 1
8 `% A% p( g2 s% x% m    move into Q_induct(procindex)1 V, b, {9 p; E+ X+ s" o
    move into pickaisle.induct(procindex)% d! Z, k0 Q/ u
    /*check the type of pickaisle.induct(i), for your last problem.*/. P: F; N' k. A! {6 |

, f( l( P( r* o    while A_i<=30 do begin
; B5 a3 Z/ x# o8 e        travel to pickaisle.con(A_i)
( j( g! K2 R- J0 G6 c& g' m  g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 I% g5 F  ?$ W( \* H        else wait for 10 sec
9 g* s  i2 D: a$ W. M        if A_i=A_leave then send to die# k" t( n" e$ m
        else inc A_i by 1
, Z( S) Q+ R; G7 [- j7 |    end, s, g. |! q0 Q, ]+ R, S8 M
end
* g1 g1 I' @- M6 `' y* P$ W" Y9 v- L, L
其中的procindex为整形,代表当前process的序号。
8 B0 V- V) E  U' `$ C, s* [6 P& istation和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-6-13 00:55 , Processed in 0.013370 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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