设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14251|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ ~8 Y( a6 @+ i+ x6 S
/ `% ]! O4 T( s3 Q" h我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ w' G6 }# H+ y" w7 F9 m$ M+ Y
0 H4 o, l. c6 p$ G- ?
begin P_read arriving3 L6 \% Z& b1 T2 L1 Z
    while 1=1 do begin
% ~- `- {3 j  q2 X0 S7 W+ _        read A_tote from "data.txt" with delimiter "\n"
0 n$ t/ Z1 [9 i6 p4 I        read A_time from "data.txt" with delimiter "\n"
4 k6 p5 P5 b- _        read A_leave from "data.txt" with delimiter "\n"
& S/ R$ X# d+ P7 F% P1 ^3 P$ X        read A_picks from "data.txt" with delimiter "\n"( A  b! a* W' @. D
        set load type to A_tote0 g$ n' S; X% D9 Q2 E
        if A_tote="tote 1" then set A_induct to 1
- ]; U/ b$ i4 u# N$ [        else if A_tote="tote 2" then set A_induct to 2& p9 L+ v. b  P) Y9 M/ {
            else set A_induct to 3   
6 U9 O4 v& f  ~        set A_i to 08 n6 K$ _) A5 w* i) O& p) N
        clone 1 load to P_induction- n8 \; M0 A4 p$ W
        wait for A_time sec) V% y/ c, e5 t; r% z
    end
/ d* c1 P! o! f* |% fend! s& \1 L. A% P% Z2 n

  P8 e  K* I- T0 a4 Jbegin P_induction arriving
& {7 W% K" y& z8 E3 x    if A_induct=1 then clone 1 load to P_pick1
/ B# V! F& _2 {6 i* {4 n( N# m    else if A_induct=2 then clone 1 load to P_pick2' G; u9 V8 P1 o7 _9 Q- s
        else clone 1 load to P_pick35 a( ]- U  h; L4 H
end
2 j2 b/ e0 J, |# y( {! y" X" y# N5 X/ ~% a* [/ P2 V5 R- z
begin P_pick1 arriving
4 C& A4 {4 q7 j/ d    set A_i to 15 M1 K* ]' s' s' A7 [
    move into Q_induct18 U. t8 x% r& u. Q/ K
    move into pickaisle.induct1' K, D; l- `" u$ U) h
    while A_i<=30 do begin7 _. X0 _2 w7 T. E4 J. X
        travel to pickaisle.con(A_i), e3 F- V/ m1 D% C& L% V4 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ X6 b+ O0 j8 M5 d        else wait for 10 sec
3 |- @. ?* h3 U! f6 p        if A_i=A_leave then send to die
: l9 N; }+ v7 W. x        else inc A_i by 1( T* x, L" O! k# }1 ]/ j! l' \
    end; W: Z' {* A  x- ~2 r9 b9 D" l& }
end
/ x) z1 F$ J+ O7 u# H! T  v7 p3 J4 J( U- s
begin P_pick2 arriving
1 ]7 `, {. m9 Z( y! q    set A_i to 11
$ }) ~0 f: s& i7 Q6 l- n1 {    move into Q_induct2/ U1 U0 X, k' {* U1 i1 W: M5 n% z0 l
    move into pickaisle.induct2
  p% k- G0 D$ ]( ^    while A_i<=30 do begin
; ~0 i6 b; i9 E; ~6 A        travel to pickaisle.con(A_i)' h  Z" X: S5 |- V8 a/ Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 \2 k6 R& o) m! I5 l        else wait for 10 sec% w) |% `3 A6 ]3 ?! V# T
        if A_i=A_leave then send to die
" K. ~2 u1 \, W; }$ U2 `7 w        else inc A_i by 1  u& p* t7 E. ^. s" N- d
    end
0 k8 h& k$ f/ W( @9 s; R0 e& s: Xend! {5 S% a2 n! `1 A) ]  O! {

; U) _3 g5 w* m  Y2 ]begin P_pick3 arriving$ i7 m9 `! j: F
    set A_i to 21
) N- k2 k$ y2 l    move into Q_induct3
. ?- r( N, S+ b2 e, E    move into pickaisle.induct3- v& D4 C7 b* Y0 R1 [! Q
    while A_i<=30 do begin
. S1 z- l, B: t* o) h3 c        travel to pickaisle.con(A_i)
9 `7 T2 g/ x( R* ]9 B        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ {6 y: D& K) r) y
        else wait for 10 sec
) L5 e* |9 v* `* F2 ?4 D        if A_i=A_leave then send to die; _% ~3 q+ X! i$ Q5 n
        else inc A_i by 1
# G4 R. V/ ~/ p    end
$ }# p1 B) _9 U% X& E3 w4 o) lend

最佳答案

查看完整内容

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是个什么东东?: ], r- D" V+ H/ a- O/ ]+ o# _7 l
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 q7 z; R! h0 Y  u$ k5 R* u  S# z& f: s, L8 @1 j) F+ g
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) U4 J1 H% e' q9 {* o$ n2 y. r+ @0 U. b
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" r2 m$ f3 k! }1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;/ S9 k* g( Y2 o! R
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- g& X: w3 ?$ q" p2 U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
- \- x9 u; V1 `7 d: X9 L: `begin P_induction arriving  _  f' z7 r: e* P0 b
    clone 1 load to P_pick(A_induct)9 j; s5 L$ r5 j3 q' t
end最大的系+ A9 H$ J6 c; E* H

3 r* \' Q: d+ f; obegin P_pick arriving; m2 M( g  U  W9 t8 G
    set A_i to procindex * 10 + 1
, {6 L+ f, k6 q    move into Q_induct(procindex)7 H1 B& i6 G; _' N+ p
    move into pickaisle.induct(procindex)
* a; Y5 |) k" p    /*check the type of pickaisle.induct(i), for your last problem.*/8 D2 }* o. E0 j8 s) Y$ \

+ X. Y& `+ ~, s" `% P    while A_i<=30 do begin8 _* j7 K/ ]; q& g4 |$ f4 {
        travel to pickaisle.con(A_i)5 N: D+ }5 B7 U, q) a. t  Q9 \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- I6 ^0 s; |& v8 ?# R1 U4 Y
        else wait for 10 sec
# c: l2 O# f  q! @, t( C. L        if A_i=A_leave then send to die
4 v$ R: Q8 Q5 [0 ]        else inc A_i by 1
  Z" H( y$ W' ]    end5 p  S; |" R+ \3 s7 C
end
( U$ \) i! c5 {% B9 T8 w4 i$ h2 C- |+ s
+ A- h% |3 [+ W; l7 G其中的procindex为整形,代表当前process的序号。
6 {/ j7 t( C& F+ _1 k- u9 rstation和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-24 20:30 , Processed in 0.015411 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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