设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12761|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 W& t7 J7 X) Y- U0 c' u  J% U( O" r) U3 o- @3 i' }1 \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ i" s  P) Z9 \- S' h3 r0 ~+ i

4 D. v0 h  O$ s& T6 ?begin P_read arriving$ {& W/ x5 M  B- ^
    while 1=1 do begin
# {$ [. N: `+ |3 ~4 ~        read A_tote from "data.txt" with delimiter "\n"
3 H" p4 A; G- ~. i% `+ g; `5 C3 {        read A_time from "data.txt" with delimiter "\n"
; o" H  W" w, Y+ F2 j: y; Z        read A_leave from "data.txt" with delimiter "\n"
& W4 j- D5 j4 }# y: |9 k& I1 W        read A_picks from "data.txt" with delimiter "\n"
" [/ p; n7 V, ^        set load type to A_tote
) x0 \2 h& @  a8 b; c, l! b        if A_tote="tote 1" then set A_induct to 18 z+ W9 X- G% Z( V) X; _/ p
        else if A_tote="tote 2" then set A_induct to 25 ?/ ?0 f* i1 c4 G. Z
            else set A_induct to 3   
% g) l/ I; s- F1 y4 i# f& M        set A_i to 0$ t8 b& b2 O: }: A) T2 J
        clone 1 load to P_induction' b' e8 y. `, `  I  V
        wait for A_time sec, p( H3 [  r4 Y- Z
    end
5 F4 l: x4 C. m/ [3 y: Oend/ j: ~) c" v' ~0 e$ x8 T

& s5 G5 M' X0 W2 K, Hbegin P_induction arriving; s4 ~3 \0 F& n0 F5 M" O$ N
    if A_induct=1 then clone 1 load to P_pick1" b) q/ m! h9 I
    else if A_induct=2 then clone 1 load to P_pick2
+ f2 P$ z+ C# s, q' @5 T        else clone 1 load to P_pick36 j, ~+ F1 U: v% _
end
  Y1 ?# W6 a7 V6 |% S
" a# c% |8 j- N2 T  j" Mbegin P_pick1 arriving
5 D0 w7 X& p1 u* b+ P! M$ o    set A_i to 1# w+ m% p; Q. c- D# l
    move into Q_induct1
8 X: s  j2 n/ ]' a+ r! @1 b( {    move into pickaisle.induct1
) T) Z/ g" B! {) e, L! K    while A_i<=30 do begin. L, H' l- y, @% \$ o
        travel to pickaisle.con(A_i)+ A( x  S7 c# t& B# ?9 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ n6 D% A. }$ ]) p/ b9 B9 k& l
        else wait for 10 sec
4 a5 N6 ^+ |" c  y' ]  `0 Z: {6 i        if A_i=A_leave then send to die
5 F4 Q6 X8 P& A1 @7 E( R        else inc A_i by 1
  v1 y  e( |, _, _6 l0 p* q* G    end
) V2 L. L6 F" \* }# Xend
2 o9 x5 S. }) h+ u; t7 T, n- t) ]" ^* y
begin P_pick2 arriving
/ @3 P+ G% p: ]9 Z9 v. g; k    set A_i to 11
2 z' j, B) }/ ^- X    move into Q_induct2
7 b0 k9 Z- `6 J  x: t2 i    move into pickaisle.induct2
- d: |! ~6 U, s8 z, ?$ p9 w    while A_i<=30 do begin
1 e% J6 t* s# @2 r        travel to pickaisle.con(A_i); m7 W# e5 k, h& P% x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; \( W/ \3 a  Q& e        else wait for 10 sec
( C5 H; ^4 f# K5 J  z1 \        if A_i=A_leave then send to die/ \& j2 E2 I5 |4 B
        else inc A_i by 1  T9 U% I4 m9 Y
    end
" {0 T/ o" C+ t$ d2 k2 Y4 s0 mend: K# k- U+ {  x) O
( y' d1 O" Q; M4 Q; K) w: c! ?) {- L4 f
begin P_pick3 arriving2 v$ L" ]" ]5 x- d* ~$ y9 _* o9 ]
    set A_i to 219 g4 l0 S7 F+ F/ H
    move into Q_induct3
4 \; Q% S+ P9 r/ j5 n- \( V6 ?" L    move into pickaisle.induct30 c, P2 C$ @" Y
    while A_i<=30 do begin) h& s, H, J2 e- h, C. r
        travel to pickaisle.con(A_i)
& Y# C( j5 Y1 y/ q" B+ ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. Y5 \$ @( _* I( d$ S- b9 l
        else wait for 10 sec) U7 q; W- b5 j, m
        if A_i=A_leave then send to die
) Y* U0 O: g$ `; H9 T! l        else inc A_i by 1' S5 e3 O% R; J$ H
    end
, E* S, B/ I- d- ]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是个什么东东?
4 D$ H, V+ W; y7 Wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 K8 G; X) G- \% B- Y( L
$ v+ _% T9 O  e, Q/ y* A6 q- x
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* }5 _, {( ^3 b- H1 w2 x  [( Q: Q9 ^- v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 a  L" R. ~4 E# G: C2 z- b" u1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& }6 `- o% m+ E
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 m$ Q+ v4 F( D; [  @3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 U9 ?6 `7 r: E; ]1 O  Z, p
begin P_induction arriving! I: o* T1 [$ r  x* a8 a5 y
    clone 1 load to P_pick(A_induct)- ?( @, H6 y% [" w' U% b
end最大的系
5 u6 U9 x- e( y. _! H/ l3 H3 q" [1 ~5 \7 T5 T' f
begin P_pick arriving
8 L' w. C* \+ V    set A_i to procindex * 10 + 1
/ G9 a' j& m, Z( L8 E# Y/ H- |4 A    move into Q_induct(procindex)
) D$ ~: q/ L+ t) V2 T2 B    move into pickaisle.induct(procindex)' V  Z9 p1 N% L5 }
    /*check the type of pickaisle.induct(i), for your last problem.*/
" X! ^3 F- V. ?! M- ~5 o3 g0 C- v0 N* I
    while A_i<=30 do begin
' G/ G8 E* H& R' R2 w        travel to pickaisle.con(A_i); z& E/ J  L* W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ c1 q- k4 c# I6 {        else wait for 10 sec
* K6 U5 x" b1 [% f' m; t        if A_i=A_leave then send to die
4 @+ ?, X7 Z& M6 ~, R: I        else inc A_i by 1
+ M! K- P4 f, g( \- @    end
& ~5 n3 C; p* `  D& \$ kend) }" ], K1 p- R+ |7 r+ l

6 Y- }$ W. k0 i7 i0 M! j1 d其中的procindex为整形,代表当前process的序号。/ J% q* ]" ?9 |
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-2-18 11:00 , Processed in 0.019484 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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