设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13520|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 h# ~% u' F! T5 M# V1 e5 r- k7 E! F9 Z' i1 `/ G+ v/ [, f- 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中的数值,不知道会不会有什么不妥。- e- o8 R* O7 x9 N8 x( g) `
* A% J- d  t* u0 p" W1 h8 A+ i6 f
begin P_read arriving( k3 G0 T0 L9 f
    while 1=1 do begin
! u, n  P$ ?! z, k. Y        read A_tote from "data.txt" with delimiter "\n"
* P  _" z4 v2 W" n        read A_time from "data.txt" with delimiter "\n"0 g) F9 ^* t! U) h9 _7 Y+ _+ B
        read A_leave from "data.txt" with delimiter "\n"1 J9 Y" I7 m1 U+ |9 P+ x; N6 Q
        read A_picks from "data.txt" with delimiter "\n"  q: w/ V$ e4 ^( I9 M, M5 B! t* h
        set load type to A_tote" T! w$ h/ N: L+ U
        if A_tote="tote 1" then set A_induct to 1  E" s" N6 K, H5 W! j# N
        else if A_tote="tote 2" then set A_induct to 21 q- L# q( x1 E+ I$ D- D% f
            else set A_induct to 3    % L5 ^& V/ f, n9 W/ o( b% ]1 N
        set A_i to 0" q6 ^$ x4 M5 S+ c
        clone 1 load to P_induction
9 c  x4 r1 y9 e( v        wait for A_time sec! o0 T/ j4 D( x
    end
" I( k3 B9 h% B  E' {end6 ^; u0 l0 w. J2 |, P" o  o

3 Y- G; w, U: D! v. Ibegin P_induction arriving8 b* u& e( q2 K! n# s
    if A_induct=1 then clone 1 load to P_pick15 G" u6 G# z# Q- T
    else if A_induct=2 then clone 1 load to P_pick2
' v& Z$ [8 u- Y) b$ N; F6 T        else clone 1 load to P_pick3
5 {) @0 I4 l+ A5 B" Gend
: I& I; W, [% u- L. B. b4 Y; V" P& a  D; N5 |# ]
begin P_pick1 arriving- F* f) L8 T1 \3 B1 ^2 `
    set A_i to 14 E  S' B+ I% T; K& v
    move into Q_induct1
4 o/ S* F4 G& O3 a/ e2 p    move into pickaisle.induct1
& n) N" h: y% G4 y* ~    while A_i<=30 do begin
  D8 q3 b+ [. J+ Z        travel to pickaisle.con(A_i)
; C3 S* [2 J5 I& ?  E2 W/ N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# P, u1 {$ c# r& q: V) x- R* u        else wait for 10 sec
+ a, T' ]' L. p( i9 e' C! o        if A_i=A_leave then send to die
) H" ]& M1 l. C4 y        else inc A_i by 1
  A0 \: X( s3 L) Z2 v+ K1 P    end( D: W! j& K/ A# n- t! I) L
end
5 ^! C* T1 D0 }/ l( n/ e& \% _  n2 U9 r- M( o
begin P_pick2 arriving% m+ q' R  W% @  z% h) e* M
    set A_i to 11( E# s0 n6 L( d
    move into Q_induct2
) t; X+ |- v1 t/ n* Q. ]    move into pickaisle.induct2
" l; v9 S. A) S! R    while A_i<=30 do begin. m6 b0 @3 ?. a4 ~
        travel to pickaisle.con(A_i)
7 D# o' O: \, F+ K$ q( E% E        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 Y  O, _9 N3 d8 w7 C+ T; w        else wait for 10 sec
# @7 J3 F" M: r3 J" r0 O        if A_i=A_leave then send to die
' _2 A$ r1 H% U/ N3 w2 W3 e        else inc A_i by 1" _6 X4 e$ z; M" r9 T; R, I  @& C  r
    end
$ G* N% u2 y! `4 @! x  D" }end
  J, E' f4 D0 f* p3 g! Q$ v& d( m  {1 N( }* y
begin P_pick3 arriving
9 J) j: P' B" }- ?    set A_i to 21% ~) ?, l  b6 A
    move into Q_induct3) }) ]7 i% g. a, R8 ]0 C" R5 ?
    move into pickaisle.induct3
, Y9 s' y! N7 {9 k2 h( ?    while A_i<=30 do begin* T8 P4 A+ R; Y' j+ t3 h" z
        travel to pickaisle.con(A_i)
* f# ]# b. K8 j' Q3 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( n' {9 P6 R# ]3 P4 E" D
        else wait for 10 sec
! A) U$ h" r. U. Q        if A_i=A_leave then send to die
* |8 Z1 p6 L4 |1 j        else inc A_i by 1
2 Y. c( @: W7 L4 q0 V8 w! h, @    end
$ i+ l* ?7 v( D3 Nend

最佳答案

查看完整内容

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是个什么东东?; q8 r* M; v+ ~) r% @0 e
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 {. ~# Z4 Z& w# o) a' k4 a9 J
4 D) z/ _+ o( J) vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
) x. k5 B' c8 D; k) g5 ?& K& u' U' q. J. A! }: v
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:1 [3 D$ R. p$ ^2 E8 a- L
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* t2 J% c+ c/ t: {8 j  D
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% [) F& z+ g: T7 N3 E! ~3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ ~' u7 |) v9 R3 bbegin P_induction arriving
, E% @) W$ p) [) A- [, ~7 i    clone 1 load to P_pick(A_induct)
: I. i# q) `. g' ~8 l/ aend最大的系/ y' s8 W3 t) J. p: D! @; A

5 e: o& P9 m5 i5 |" i( Ebegin P_pick arriving3 h( g# u, S! s
    set A_i to procindex * 10 + 1
! @1 d% z  P) T+ w) m' Y2 t    move into Q_induct(procindex)+ \: l1 ]+ \. O4 q$ i1 }
    move into pickaisle.induct(procindex)9 {! \" p- ~7 X: w. J8 q9 Q
    /*check the type of pickaisle.induct(i), for your last problem.*/1 E, Y- ?3 r5 G  v; L) Y5 ?( c
; p& v+ S% F- U1 R+ @( @; t
    while A_i<=30 do begin- N( P" C3 u9 D; d* V. Z
        travel to pickaisle.con(A_i)' M1 B% P# ]2 b3 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# V5 Z8 f' V5 s        else wait for 10 sec' A  \: I- V( ?4 J' d+ A
        if A_i=A_leave then send to die( k4 W; z  ]$ c) W- F
        else inc A_i by 1; E, a) u! \, \( m
    end
7 g6 R  l' i4 j. @end! A* n3 O, L0 Z: n/ o
# u& I2 w. V0 X1 F+ A
其中的procindex为整形,代表当前process的序号。
$ _# m. o/ m4 v( a- |! v) b  Hstation和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-4-19 05:19 , Processed in 0.014504 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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