设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15460|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" u6 _( P4 o# ^+ g& x1 }# n: R: f  Y; E" [3 b+ v& D  ~, z* E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ k4 g2 a/ ~2 j, }: T3 d" A6 a5 ~) t$ l& g
begin P_read arriving
3 V7 y7 L8 x& k3 p$ S    while 1=1 do begin
% ^, _' U% W0 R( q6 k7 C6 U1 g( J        read A_tote from "data.txt" with delimiter "\n"
5 j$ g/ P9 u4 Z% t. @        read A_time from "data.txt" with delimiter "\n"
# t! P( q: F' V  z4 T% w8 ~/ ?        read A_leave from "data.txt" with delimiter "\n"
( w# f. U% e! x0 n: W& X        read A_picks from "data.txt" with delimiter "\n". D; C1 C$ n6 X' G6 o% K1 S9 s
        set load type to A_tote
: s+ G1 ?, F* O, M        if A_tote="tote 1" then set A_induct to 1
9 p, L8 f2 S" J" a* g# @4 m        else if A_tote="tote 2" then set A_induct to 24 T  @1 }" \( K
            else set A_induct to 3   
2 Y) E4 L4 j( G  l6 u+ a        set A_i to 0
( B6 H6 A* c  T2 g( D1 w9 Q        clone 1 load to P_induction
8 e: o; [) U% p9 X        wait for A_time sec
0 J  G% F5 w7 M5 s- F: z7 \6 H3 u    end
$ l, L3 U! C! K8 Send3 j) L" }( c; J$ I+ L8 [

6 O1 l( y8 @  Ebegin P_induction arriving
% O* n' e+ f4 }) Y0 ?2 P& {    if A_induct=1 then clone 1 load to P_pick1* }2 H& D& }# u
    else if A_induct=2 then clone 1 load to P_pick2% u' e1 x' Y1 j1 B6 S
        else clone 1 load to P_pick3
+ j; F( V' |' E1 r  N8 }$ Wend
: ~. a0 M3 ]* i1 N0 I; g4 D. o6 o7 Q- l
. y9 `2 S0 Y% u7 O( \- `begin P_pick1 arriving
# w" i9 n* y8 n9 N    set A_i to 12 z8 m; \, {9 d& O0 L2 U
    move into Q_induct16 u0 T6 F; I2 ^  w. I; @
    move into pickaisle.induct15 P7 X% S" I; P* X  R
    while A_i<=30 do begin1 e* U& L, [3 m* O; A3 h
        travel to pickaisle.con(A_i)
1 e  w9 y! \5 L/ E9 X$ ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: l0 G- b+ |% y7 i& o) G$ s3 y5 H5 B        else wait for 10 sec
1 O$ [4 s1 c: X7 c5 n# X5 b& ^3 v' ]        if A_i=A_leave then send to die
% {( W( H& M' ^1 P  _        else inc A_i by 1) ]: W6 J& ?: U% `
    end
# Q9 H+ h8 ]4 f7 I9 W5 l5 c! {, dend
( l& u; p  X/ Y" f+ Y0 O+ a8 f) a4 O! S+ h& M
begin P_pick2 arriving
6 Y/ M& p  J" A- j4 n5 U* {    set A_i to 11
  W0 T  _) I* ^$ x/ Y' w    move into Q_induct2" }% _7 f2 ^+ T, C
    move into pickaisle.induct2
: F( w4 C" y! L    while A_i<=30 do begin$ h% r- l7 ]* z
        travel to pickaisle.con(A_i)
1 _# s2 q  l! E5 L6 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 w/ P3 v5 k& C' w9 Q' m! ~+ Y        else wait for 10 sec
* ^9 N) k. Z, ?4 O0 W7 V$ g        if A_i=A_leave then send to die
: Q) T& X8 F+ }& h1 c4 A: Q& O        else inc A_i by 1, b" r; y' p, p7 s) W
    end2 D$ N  x) C% q- p  v# Y; b% l9 Y
end9 G6 _( n8 r  ~1 ]( E  @  h

' q' m* [4 l, t  mbegin P_pick3 arriving
/ U) ]& K1 c8 y- ?    set A_i to 21
0 ^- ~8 I  |% a- {    move into Q_induct3; z; B7 x3 K- }) z- y
    move into pickaisle.induct3
0 S- r8 X) {8 [1 \6 a4 M    while A_i<=30 do begin, t  U* ~( W9 m0 D: X# t
        travel to pickaisle.con(A_i)
& b! T, Y  ^" |$ Z3 Q9 N$ f7 [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" }1 B; Z9 o  C8 x% o
        else wait for 10 sec
, e4 ?( o5 p7 D# N6 J1 C        if A_i=A_leave then send to die; t/ B  E, q* K& Y+ {1 F  r. ~" T7 L! a
        else inc A_i by 16 w6 G+ ~) {) G+ I7 ~
    end
9 h9 e' S& @4 q0 wend

最佳答案

查看完整内容

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是个什么东东?: j* _3 d! }2 s3 }9 H4 j$ v
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?/ i$ p/ e; |5 T  ?3 F$ L
) ?2 |0 c$ E4 I$ n
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 P& q3 T% b: f2 \

  t* [  N9 S' h6 W! D+ }6 U# l另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 e/ G6 |6 B7 j; A
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  m; D( H7 M) Z% u: ^
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; f& H2 i5 L8 D/ c; B6 S1 ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 S0 A" p/ `' L, j. A, r: F* A4 T
begin P_induction arriving
9 R, c% O; x  @/ G    clone 1 load to P_pick(A_induct)
! s' n* R, k6 k4 ^* |end最大的系
/ R$ _6 e: m5 @2 h: Z$ C! L5 y* s& ~8 H
begin P_pick arriving! b' `4 _' [8 h: W
    set A_i to procindex * 10 + 1
3 z/ H7 M; _, s) u    move into Q_induct(procindex)+ L$ m2 j/ V4 V$ w9 Z5 W2 u: ~
    move into pickaisle.induct(procindex)
( g( f+ K2 T" ~! `- g4 E6 P0 B9 W    /*check the type of pickaisle.induct(i), for your last problem.*/
1 F9 j  ~3 q5 p  |
& C- _8 _& b9 V4 E- O' \) Z  i, }    while A_i<=30 do begin
7 ]7 K3 ~( b7 _9 O        travel to pickaisle.con(A_i), c" J7 x" g0 U! s0 D, s/ \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# F( x/ H! N5 ]% X8 U* l7 }6 S7 O
        else wait for 10 sec
, @9 q' T2 A4 q; K        if A_i=A_leave then send to die0 c4 L3 t) P( K  L# k
        else inc A_i by 1
# x6 w% S+ i& x+ _, {( `    end0 ~+ X( k! ^+ h
end$ K. N$ U; X. n; u  h3 Y

$ _$ y' L* x9 V其中的procindex为整形,代表当前process的序号。
: O6 f- V& e6 i: bstation和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-9-11 15:32 , Processed in 0.017583 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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