设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14135|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' K) ~  o6 v: o- {$ @0 M" ~; T% n% b( O' K* D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 ?7 t. D; b* ~6 ^1 W$ u& m6 b% ^/ q0 [$ r- q/ f' w; z  R- O. g1 U1 {
begin P_read arriving% D+ v2 v7 \4 u6 D& k7 c
    while 1=1 do begin7 `( b# b9 N& B
        read A_tote from "data.txt" with delimiter "\n": H" N) j" X  ?5 M$ y
        read A_time from "data.txt" with delimiter "\n"
- \# @% y4 N9 ?% J- @. M        read A_leave from "data.txt" with delimiter "\n"
8 Y: J4 }' V/ o7 q3 o' }3 w: z: B) F        read A_picks from "data.txt" with delimiter "\n"
0 T7 d" R  F  k  U" C0 A! _- q        set load type to A_tote
- k& I4 z% E+ R+ m9 L& F. G0 E        if A_tote="tote 1" then set A_induct to 14 c0 p5 s) u% D/ _
        else if A_tote="tote 2" then set A_induct to 2
) H, B+ h) _& h5 ?0 p) w            else set A_induct to 3   
" A; x. E; U% E0 z4 B! F6 F        set A_i to 0
# t; K7 q! T: w* |& |        clone 1 load to P_induction* D7 l4 {( N& b7 X6 ~! a* @- {5 g
        wait for A_time sec) U, a5 K- v- u% l5 R: g# R6 v
    end1 @5 y4 d8 z- ]/ G  `
end* f. \9 D1 t+ Y/ @9 p6 a5 E4 z: a1 ]

8 K. ~: B* ?6 C6 U7 B' |begin P_induction arriving& F4 s2 O8 k; k& M6 `
    if A_induct=1 then clone 1 load to P_pick1; ?0 |4 M$ g" ~
    else if A_induct=2 then clone 1 load to P_pick2
( n! D* u& k1 B# z& l/ j        else clone 1 load to P_pick3
% |2 Y' Y! t+ A( V) U& Rend, x$ F! |/ B: K$ W1 {3 {
4 R# n8 L% z! b: ~( `
begin P_pick1 arriving
, I/ J' V! N4 v! ^    set A_i to 1
( {9 J# G' c2 k3 w' e3 n    move into Q_induct1
; o% |3 A4 A0 B* R2 q: f    move into pickaisle.induct1
+ V6 L$ }4 X, U4 g1 @+ L    while A_i<=30 do begin4 m( L9 \7 T6 N' y3 G7 i- N
        travel to pickaisle.con(A_i)
& f: J$ r2 h% I4 E) b% D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ t; k) [, a  p/ p/ d2 g0 R
        else wait for 10 sec
) ]7 }  Q  F8 W5 B* o. x0 C! a& A        if A_i=A_leave then send to die. }- R! a4 r9 p$ f+ X* P( n
        else inc A_i by 1" w0 K0 }6 F( D: o
    end# x; n8 F+ a  f/ ~! H& k
end
3 G/ L1 }- w8 }2 e: X  @$ n4 W; E( K. B$ g  I, |
begin P_pick2 arriving
9 G2 |% ?6 N- n3 P) v' r; F    set A_i to 11
9 M, J: G- m  K- L# [5 @    move into Q_induct2* o; j3 u# T3 ~/ o: w4 V$ x- C* C
    move into pickaisle.induct2% P; q% d- ]2 ]6 {9 Q( Z
    while A_i<=30 do begin6 l6 ^  T! q! p3 h- e
        travel to pickaisle.con(A_i)) o- E! b' Y3 |0 n9 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 R( [. y9 |2 y# Z4 E7 W        else wait for 10 sec( |$ M8 R+ n7 C5 U0 g* M* w: q2 u
        if A_i=A_leave then send to die
' I/ ^# d/ p- C( b, d7 o) B$ E        else inc A_i by 1. l7 S- A! N3 T5 Q0 J9 H
    end
. F1 P8 \. Z7 m* `- j2 Z! Aend
' T( @8 O! u1 n/ `) b' K" S3 e3 `0 O- l# W* i* c) e0 w' {
begin P_pick3 arriving* q/ P8 G% T5 y7 H) G5 i( p
    set A_i to 21
  t* z! [; T  `- R    move into Q_induct3$ s- Q  {9 K: y3 J
    move into pickaisle.induct3! |8 W( h8 L4 v. n/ K( P, d
    while A_i<=30 do begin
! |& B3 {# v* c; |        travel to pickaisle.con(A_i)
# p0 j  {. L* G9 z4 u! L& L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 z% i0 A8 G7 q        else wait for 10 sec& ~7 ^; {7 F! [7 K* o) W
        if A_i=A_leave then send to die
# [' o5 j7 \0 t& K3 V5 b. U        else inc A_i by 1
  Z, ^7 W4 b4 P# x% G$ a    end) R! ]- v* F# S, c2 E( z$ \
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是个什么东东?+ c& c3 _4 @9 k9 s' a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- N8 R9 X) _: }6 j' [

# Y7 ^; u- Q0 L- Y" iAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 O4 z4 ^' W  u4 E* \2 z, B* F
$ q9 i& a7 j6 N! S7 \  A另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
) A" K' \: S) n+ U# T. M, Y; D$ P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 G5 r! Q8 Q, D+ k  U: _; @. U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 |& V- R+ j# }8 i; o3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! m6 U/ Z5 H" C  Gbegin P_induction arriving
  X. [# a, o. w! w    clone 1 load to P_pick(A_induct)
0 o/ c2 a0 n( B( F; I1 Pend最大的系3 W. S$ p+ e6 i/ s  |! n# n7 e

! b* G. j# v. |! t4 F9 [% O; y) jbegin P_pick arriving
: M' I! O7 S- z5 e    set A_i to procindex * 10 + 1
# T+ o: L# l2 Z  ?- m    move into Q_induct(procindex)
) O: A8 ?, A7 p" N: e% j7 [    move into pickaisle.induct(procindex)( j" q$ D, v. m; Z) g" t3 n
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 O7 c- {8 f& _, ]
$ \; Z" Q* J6 C0 Z+ F6 n0 m: ~& \  ^/ u! I    while A_i<=30 do begin( Z$ M$ d9 J& r$ s  @
        travel to pickaisle.con(A_i)/ w( M+ I/ n+ N: e& q- T! O+ P$ K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* R2 H, b/ A8 v! H
        else wait for 10 sec! e3 \$ h! n3 }+ e9 K& Q6 X/ C
        if A_i=A_leave then send to die( y) S) ~+ v, W' f! A, k* {! v
        else inc A_i by 1
, ^! s; A4 ~: h$ z    end
$ z. f8 x, |% x8 bend
* L4 p3 \4 `+ A6 Q" m
- J5 T$ j- e' m( J+ T( m! e其中的procindex为整形,代表当前process的序号。
0 V, m0 C& [. d6 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-12 09:25 , Processed in 0.023823 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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