设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13701|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 T. {- E2 m0 i* W& V1 C& q
1 c) \- O! A% g( v. t$ I
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. F+ [7 H, |6 w' f5 ]2 f" y( n' I' p/ h
begin P_read arriving3 N: @7 ?7 R1 y4 E
    while 1=1 do begin- v0 s2 F) B4 S- r) H3 H
        read A_tote from "data.txt" with delimiter "\n"5 z! `: \& v; d& U/ f
        read A_time from "data.txt" with delimiter "\n"+ s1 Z/ \& |; o- i, T3 F, W
        read A_leave from "data.txt" with delimiter "\n"
7 H- {! q+ E/ H9 }5 O        read A_picks from "data.txt" with delimiter "\n"
# i' g' u. C1 d; K7 Z        set load type to A_tote8 J0 ~$ _4 w' \9 g. j3 L- @7 u8 G: O
        if A_tote="tote 1" then set A_induct to 18 W8 X2 S' R: M4 y
        else if A_tote="tote 2" then set A_induct to 2$ B  p3 G4 P* w0 g+ X5 G
            else set A_induct to 3   
  F8 Y) z# c; X6 ~7 n        set A_i to 0& _0 S3 _9 A0 b6 n8 m3 Z; l
        clone 1 load to P_induction! e& |. u3 V  m8 }" W0 J
        wait for A_time sec/ Y9 O' @- ?1 a- E
    end" U5 H: i2 y; g/ L. H) P. r
end
1 n6 b# T$ N/ [; o4 g# @" `8 W3 {1 h6 B) o3 f6 ?. f) e; n8 V+ p
begin P_induction arriving) l' w/ G+ i) k, I& S3 F/ @
    if A_induct=1 then clone 1 load to P_pick1* x0 w' O9 H% K. A# o( X! Q
    else if A_induct=2 then clone 1 load to P_pick2
  J7 P) q. t6 B8 i        else clone 1 load to P_pick3( P  q5 p& g( ]7 @! x3 N7 j
end( ?3 n  H6 \- c. {
% b5 P3 K1 f0 X
begin P_pick1 arriving  K5 M7 s( l* O, m# c0 b
    set A_i to 1
1 W+ s. k6 h! }6 U" C9 h5 T  A    move into Q_induct1
, s* [% S) e& b7 }  F    move into pickaisle.induct1+ o& }+ j5 Z& [- u6 n
    while A_i<=30 do begin' U! {5 ]" w& N
        travel to pickaisle.con(A_i)
) g$ ^* p& U$ n% I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 z9 K+ n5 K3 W* `! v' U        else wait for 10 sec# `% Q2 X- J* _$ b* b9 }
        if A_i=A_leave then send to die1 I$ K$ a4 j- Y3 O5 ~! w2 A& _
        else inc A_i by 1
& f* O. K, L3 K    end
" K1 \1 d9 h9 V4 F  J: s  nend
+ i2 r, W" W+ _) f( _) R* n6 q2 S9 t$ d  ]5 I% q. {  b/ Z
begin P_pick2 arriving
0 O& H4 {. V+ D; v' P! U    set A_i to 11
; K* Y* K$ Y% s* K/ y6 {: N    move into Q_induct2% v, ?; [% m- _' J* y
    move into pickaisle.induct2$ V5 a1 q& t) V2 U+ q3 x
    while A_i<=30 do begin# C  |- U! \, \, J
        travel to pickaisle.con(A_i)! P$ w( B: X4 S0 l5 v# x% \6 {' x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& O+ }' t1 [7 z: U        else wait for 10 sec3 b8 v7 M4 m* |# a; L: B1 m5 q
        if A_i=A_leave then send to die
4 n% o- m( T1 J+ t" S        else inc A_i by 1
! \( C8 r6 S6 u4 J    end2 ^# g& c4 k8 ]& @7 u& I- t
end1 H: ~$ ?1 t, A9 T; v. e9 W
% t3 U0 Z$ m6 Y+ }
begin P_pick3 arriving  o# k4 f9 U7 R& H5 c3 ~
    set A_i to 21
1 `, Y. D- R! V" h5 x    move into Q_induct3# P/ |# n$ S9 N: D, v
    move into pickaisle.induct3
5 _" d; T3 h1 [7 U    while A_i<=30 do begin9 N8 r. B$ h2 `0 i
        travel to pickaisle.con(A_i)! y  j; D7 N& c* C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 W; k# N+ j! h' p) b  P' ]        else wait for 10 sec
# ~% X8 M3 }, g6 I. {* L        if A_i=A_leave then send to die( h  N$ c+ v$ M: A7 V; d
        else inc A_i by 16 u5 @. I6 l. O2 l3 Z! ~" z! G
    end
2 I4 h7 g2 }& n  P; \- 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是个什么东东?1 _! \4 b, q% g' X. {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' O) N7 \7 t+ y0 E9 L

, R! _' r: k# `' C8 VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 f5 s' n) K# Z

0 ^  e' V  `8 w# V6 d+ x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 n6 C0 O& e( I* o- r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 x# V' B6 u1 |: L2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- g3 j' L- h) m! k3 i* y
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) ^: R1 i, x* z- p" j+ {
begin P_induction arriving
  I' l$ i' X9 U5 k2 F" x0 F    clone 1 load to P_pick(A_induct); U; j4 A) t* i  B
end最大的系
) x2 O# p5 l8 ~& h/ T" ~+ ?* X+ n1 |% J# w! X$ O6 u6 ]# u2 G
begin P_pick arriving
& |$ d1 W( w/ q% j% E7 k6 {    set A_i to procindex * 10 + 1
6 K# j2 W8 M# v! R8 _    move into Q_induct(procindex)2 Y1 w, s2 b: O* U, t# i! |% [
    move into pickaisle.induct(procindex)
* d& A) T1 y7 [( o; _    /*check the type of pickaisle.induct(i), for your last problem.*/
9 k+ k, {+ x: n$ }' N# Z9 {
2 ?  q5 Z8 H' v6 b4 q    while A_i<=30 do begin8 h- u$ P1 ?1 `
        travel to pickaisle.con(A_i)0 t# c6 E2 x+ [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: D3 W* ^$ B6 T4 r        else wait for 10 sec  |' X  w6 p& ^& x) d
        if A_i=A_leave then send to die
- t/ E5 o& B& s( ]3 i8 Z        else inc A_i by 1+ W$ }; v% p9 n! z. T
    end
+ I/ j! Q/ U% w. t+ K- Iend
% ?' ~' A* ^' }( P+ v7 e) {: `7 m9 v$ @0 {
其中的procindex为整形,代表当前process的序号。! f. g4 b: _: X4 A& e: w& U3 u
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-4-29 17:11 , Processed in 0.014636 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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