设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15130|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ @5 k8 D1 B( j8 p3 w1 q- q

$ p3 j) N6 i" t我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 T" L, G2 Q( ?6 g. I8 |3 X

. t7 A0 ]5 S' h+ S8 @begin P_read arriving
6 o7 x: ]2 l7 e2 L  D/ r    while 1=1 do begin  [/ k6 l: Q3 w2 o8 ^3 ~
        read A_tote from "data.txt" with delimiter "\n". k  O' j7 a* Y8 H, R5 ^8 X6 P! o
        read A_time from "data.txt" with delimiter "\n"
5 D0 X, |8 r; p* ]. x0 X) s        read A_leave from "data.txt" with delimiter "\n"' a: N( E9 D  y% a5 Z
        read A_picks from "data.txt" with delimiter "\n"$ ]# ?9 h4 ?+ M+ r% r) t2 M' N( o# Y
        set load type to A_tote- j3 y/ ]+ {! ]4 F7 I* f
        if A_tote="tote 1" then set A_induct to 1  G* w4 o" q% A. i
        else if A_tote="tote 2" then set A_induct to 27 t* }# A, n/ T, i
            else set A_induct to 3   
) |9 }& k* I2 e        set A_i to 0
& J) r+ x" A& Y. a  Z        clone 1 load to P_induction5 K4 n9 z% V5 ~8 g  J
        wait for A_time sec
, F" E  R! c: A6 U    end
% T( O3 p( b4 P+ M  O% bend
# F: o8 u- p1 T! G7 ^1 I* N& J9 ?# ^2 {# i7 w# Q) y$ J  m
begin P_induction arriving
1 @% N* }# S6 z0 ?8 c2 Q. m/ K$ B    if A_induct=1 then clone 1 load to P_pick1
2 {; k  @  t6 B) f    else if A_induct=2 then clone 1 load to P_pick24 V$ ?1 n5 z3 u0 T; a
        else clone 1 load to P_pick3
. i6 G; n! i+ M* v: Bend
& z5 W4 p6 D0 X4 d4 Z
0 H6 e' l0 Q/ N7 E) qbegin P_pick1 arriving7 J* H6 K0 _1 w5 o
    set A_i to 1
0 D/ C1 Q5 I9 g& K; f0 w2 v    move into Q_induct1
! f, a' v# y& @" ^    move into pickaisle.induct1! w6 Z3 h0 k) B! T3 w
    while A_i<=30 do begin
2 [" f: w+ _3 q) u2 O" J& S        travel to pickaisle.con(A_i)3 b2 P6 x( w: {  k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- v& `" M' e+ S4 Z        else wait for 10 sec# S! ~' Z1 V( ~1 A7 n3 Q/ N
        if A_i=A_leave then send to die0 M. U, i. a3 I8 I3 g% o
        else inc A_i by 13 K0 a( d8 Y3 K
    end
% P: D  {: i) u" r) G  {end1 E" R( K7 B+ e; i/ M

3 T$ D5 _. b7 j1 |begin P_pick2 arriving
5 ?6 N  E1 x, ]% r6 M+ Y" q    set A_i to 11/ h" }8 i! F" I% u. p
    move into Q_induct2
6 A0 n' W: Z/ r  ?( S3 b8 f    move into pickaisle.induct2
. S5 G6 I* G# g$ ?    while A_i<=30 do begin( R: {; P% w2 q9 y( p
        travel to pickaisle.con(A_i)
! T* F% N$ _6 `/ ]" [( D- j) e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ Z+ i$ I5 k, g9 W& X, o9 \% a        else wait for 10 sec
* F4 r. }7 [9 ^3 Z0 O& C2 \- A3 M        if A_i=A_leave then send to die
8 }# V6 j2 D8 @" r        else inc A_i by 16 J6 E6 E6 [6 q3 Q+ @
    end% G& q8 `4 X5 y5 j0 H+ r
end
; R2 C& d. R4 @1 W( U$ \. b
6 W2 L" _4 C& v4 O1 l' q  _begin P_pick3 arriving( i2 u* W- l  M' Z" ^- z' ~
    set A_i to 21
7 e" }" Z! A  H% Y1 P8 u) w( p# J    move into Q_induct3; ?' `& u+ B# c$ k2 W% W" S
    move into pickaisle.induct3
6 ?8 J  h1 x% L* @! b6 A8 C$ i5 e    while A_i<=30 do begin6 K5 t* I  j& w- Q; C, A1 Q
        travel to pickaisle.con(A_i)$ w; S9 S. y8 [" _* x- I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 \' b, ~9 p0 V        else wait for 10 sec
( ^5 P* X" R" j+ ~. h' {        if A_i=A_leave then send to die
  k/ Q, u" U3 K) G9 W. v        else inc A_i by 1% L3 s) k! q3 j$ B5 [0 B. f+ n1 v
    end9 N' m6 C6 O& s" ^8 y( z6 Z- `9 Y
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是个什么东东?7 h0 `. W8 `0 p9 v+ Y' h. D2 u6 E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ K. j  T& e  ^5 ~+ q
. h) j3 F4 m* nAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 j; A9 I5 C! a$ u
3 e+ w/ z- m; m3 ^: @' @" A另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 q; s, Y9 x% Q5 b- J) |' {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& K5 S$ B* D- v9 b- O2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;% h2 V5 B! t, \% U" O* J
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:5 [6 C, v0 X: o' v; I1 p3 B* T
begin P_induction arriving
, T. y. w! W9 r& x" ?    clone 1 load to P_pick(A_induct)
1 R) n1 D2 ~  D# \: `& Send最大的系
. j' ^5 m8 r# {3 F7 a$ D1 t( x; S4 P
begin P_pick arriving. b5 ]5 }$ p' g, ?9 U
    set A_i to procindex * 10 + 10 b/ G" j+ x4 C9 Z5 U
    move into Q_induct(procindex)
: P: H) h8 L  J% _1 N. ~" T    move into pickaisle.induct(procindex)+ x7 H( ?4 ?3 b1 v1 t
    /*check the type of pickaisle.induct(i), for your last problem.*/& |- R: Q( K4 e1 x
5 U4 y6 N2 }, g. ^
    while A_i<=30 do begin  v) S; T" V$ l; z% ]  e/ `
        travel to pickaisle.con(A_i)" v3 s  N% l: l  P0 b* E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 S; e) b; i  O$ y
        else wait for 10 sec4 P* j* u) ?% h1 _5 T
        if A_i=A_leave then send to die
& T+ X$ S- _, V1 [        else inc A_i by 18 y  ?6 L  _* q* R8 W
    end) c' z# R! i, n8 B5 b9 E- U; ?
end
' E4 G, `6 E/ O0 ^( W" v8 a" }+ }! B( P* @' z
其中的procindex为整形,代表当前process的序号。1 u4 E/ Q( Z- F. o
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-8-13 05:16 , Processed in 0.019886 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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