设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14822|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) b( D0 A* P  _9 P! v/ s
: I: a, c, m5 v5 L5 ]3 g/ m我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ?. T4 X* j  o* j; q/ E% W. u) A/ \) X% U+ C- j8 L3 G
begin P_read arriving0 D& |& O$ [: b: M
    while 1=1 do begin3 w7 N( W8 w9 \. X
        read A_tote from "data.txt" with delimiter "\n"
& K5 U! z$ k5 X( G2 z        read A_time from "data.txt" with delimiter "\n"
4 I% \) U" U0 ^1 q1 j& }        read A_leave from "data.txt" with delimiter "\n"
  z' ?) F5 i! `        read A_picks from "data.txt" with delimiter "\n"
, k' ]" K+ [- d0 ?' Q9 x5 X. J        set load type to A_tote% u7 N  ^5 u2 y
        if A_tote="tote 1" then set A_induct to 1  m4 o& w6 S% H4 x) R! I
        else if A_tote="tote 2" then set A_induct to 2
2 ^$ A! ^3 G( Q( l7 {2 K            else set A_induct to 3   
% }4 t0 H3 t. W0 w        set A_i to 01 b# r  z- d$ g8 S6 d# A/ h
        clone 1 load to P_induction
# y6 n/ Z; ?/ e2 W. v' o        wait for A_time sec
! j7 C4 k& a$ P" r' ]' L) e    end
+ ?! K. E0 X9 D2 J, U' qend7 a8 _% B" H0 e

) ]6 h3 q  ?! H* [begin P_induction arriving
$ L' y4 L- }. [4 L/ U0 Q    if A_induct=1 then clone 1 load to P_pick1) p/ k9 l$ @5 Z5 ^
    else if A_induct=2 then clone 1 load to P_pick2
- y7 X: M  J! A( s% x        else clone 1 load to P_pick3
2 W, V9 t6 v/ q6 L1 Oend
" S5 `3 H+ u8 M: h- \& ?' f$ G3 t+ z" a# M' I3 J
begin P_pick1 arriving
% f% }* F" A+ B9 k    set A_i to 1' B6 t2 O5 D. B, |4 D6 W. V3 `# L
    move into Q_induct1
/ ^! n; s. f- o1 n    move into pickaisle.induct10 Y& j3 @% y# O$ T( d$ N2 {3 y
    while A_i<=30 do begin
" A0 X/ W3 n. n. ]6 ^5 r1 h2 d        travel to pickaisle.con(A_i)0 {1 g( |# {" @+ j! Z, X
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 o) ?9 c+ w3 d9 {7 V) F        else wait for 10 sec
7 Z2 P" e' R8 b8 j, [. B1 C1 O        if A_i=A_leave then send to die8 _. U" ~/ l. ~
        else inc A_i by 1+ q+ _% k$ n9 _+ c. w! ^
    end; v( i' _, F+ [+ A
end
  y) N. W9 q3 Y0 _2 i: b: K
/ p/ n& [# H3 W8 t! Cbegin P_pick2 arriving
& U. A3 m) P! m2 S7 j( t9 a& L    set A_i to 11# t0 B8 z* Z4 V5 v
    move into Q_induct25 B1 @) A4 Z: Y8 P' P& c: g
    move into pickaisle.induct2- ]- d! X8 ^5 c0 [1 K0 v7 Q
    while A_i<=30 do begin& l# h1 d! q6 ]. e2 n8 r
        travel to pickaisle.con(A_i)
& W1 F; t) m# T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% E8 m! o+ h- R8 {/ e
        else wait for 10 sec
' [+ n; M2 w/ R        if A_i=A_leave then send to die  R1 d  X' {; r+ [. G$ Y* o6 s
        else inc A_i by 1
; J7 [2 S& V) B, l    end
4 g7 A+ W* ?( ^$ l0 |end
, O/ Z/ a3 `8 i, W
  J' ^$ i* A$ T1 G) h, e" `' {begin P_pick3 arriving
, W( l1 z6 e- n. [, P4 v! ~! M* x    set A_i to 21/ }' `$ u$ Y' W* J
    move into Q_induct3
/ R/ V8 W$ a- i6 C7 v7 V    move into pickaisle.induct3( C$ D, ^, Q! z
    while A_i<=30 do begin
5 H  }" i+ A8 H3 {# y5 n8 P        travel to pickaisle.con(A_i)
6 m& x+ M+ n  L, |+ O7 u  T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ d, v, h9 f: v- f- y        else wait for 10 sec
% a. X9 h! t2 I' k/ g" n        if A_i=A_leave then send to die
: L& ?; F& |/ u1 J$ W( H  ?        else inc A_i by 17 B) _5 J: v- M* C
    end& _4 j; d% |& U& Z% K' U3 I( b  c  J1 V
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是个什么东东?1 @# X) x3 O( _9 P1 S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 I: I0 g' Y$ \! p5 w" s3 g" y- `4 [% n0 \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 S3 v+ f7 v; p) ~
9 g3 D2 C8 X$ w/ @7 G8 G  `
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 F0 j% D; q$ {; P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ _& m- n+ T$ J# M6 P/ ?2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. q0 |" [, h! E, w, u& {0 ]
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 Z1 }1 q; l$ S3 E& X
begin P_induction arriving
- A4 [/ W+ `' m    clone 1 load to P_pick(A_induct)
& R$ m! ~, G$ H9 Y# send最大的系
8 E) g6 i( P8 M$ r, d& l: v0 U; ~9 W) G, n7 M/ n% A
begin P_pick arriving
, g! ]6 q3 L& _2 u( O8 ]( j& c    set A_i to procindex * 10 + 1
- [1 O/ H! U) X2 E- Q, J, S* N$ P    move into Q_induct(procindex)
6 o5 J4 I0 I& v  e& f3 U$ k    move into pickaisle.induct(procindex), s, Q; Z+ E3 U
    /*check the type of pickaisle.induct(i), for your last problem.*/. ~' E7 f6 g2 W4 D9 U( x
+ m( D; T  V" `* ]0 O  {
    while A_i<=30 do begin
# j" F' t, C' H) }6 k6 o& {        travel to pickaisle.con(A_i), @$ V$ [: N% Y8 L8 D& \* d+ m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" ~$ T* B6 j) y        else wait for 10 sec2 a5 O( M& ^; ~
        if A_i=A_leave then send to die3 ^  K, g% U* v3 V
        else inc A_i by 1
' X' Q0 h; B1 q2 i- E' w    end
& g& t% v8 g( b* B- x1 eend4 `0 b4 ~3 A: L) o( g" L

+ @: w4 V) X9 T, |+ h其中的procindex为整形,代表当前process的序号。9 |& ]! ?1 p! M; s8 J& W3 x
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-7-28 03:22 , Processed in 0.014832 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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