设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13962|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 T# U4 ~$ H  n# K  v7 r
4 H% f# d8 n5 L% b  r$ Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ L5 b  W0 y# z$ i6 d

) X7 p1 Q) {, O0 mbegin P_read arriving
6 C# g$ H1 x% k  |7 c5 A" k    while 1=1 do begin3 O) n6 i8 V- q2 Q
        read A_tote from "data.txt" with delimiter "\n"
7 v/ \. [! ?7 o$ R- X5 |' E/ J        read A_time from "data.txt" with delimiter "\n"6 j5 p" n5 F, d, e$ Z! w! j& @9 o
        read A_leave from "data.txt" with delimiter "\n"! k& q4 o8 e! K! J6 q
        read A_picks from "data.txt" with delimiter "\n"
0 y8 q$ ?) p% ]2 c, p        set load type to A_tote! g4 z& Y0 m7 b. F3 C9 p
        if A_tote="tote 1" then set A_induct to 1  S  k, R& X" f7 X7 p0 `5 o0 u* _
        else if A_tote="tote 2" then set A_induct to 2
6 K# ^* [" b+ K5 ?) ~+ D            else set A_induct to 3    - T' Y% W, {. e, d& v5 Q
        set A_i to 0
- k9 h7 T! ?" v        clone 1 load to P_induction
* X- \7 B- v" |( C, c- h% P        wait for A_time sec
" o! s* l' _, B4 n1 P    end% c( `0 d1 I0 n( G; Y
end
( O3 c/ F/ {0 S" z6 G. e5 {3 W
. ^# J# d  C1 O9 D/ }& Vbegin P_induction arriving
$ o5 y' w9 p/ [% B9 e) W. x    if A_induct=1 then clone 1 load to P_pick1
- Y3 U' b! u1 F; y. _3 K+ m5 X: }    else if A_induct=2 then clone 1 load to P_pick2
  `3 C, X- m" l) A3 t5 d        else clone 1 load to P_pick30 F$ X! ~; |" c) y
end
% S; ]* ^% \2 g& t# F0 j
* u! E1 F+ `- |+ c# Abegin P_pick1 arriving* Q8 u) l" X4 }6 e
    set A_i to 1
4 W' f5 C  [  r8 v% z    move into Q_induct17 m& Y: G2 f  u
    move into pickaisle.induct1
2 |& X; x/ c/ F6 H" ^    while A_i<=30 do begin# o1 c* v# I) C) R
        travel to pickaisle.con(A_i)
( t3 k2 a& t) k' U3 ]3 o# }' l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 b( z8 g& ]; _) K5 U        else wait for 10 sec
  I9 O2 U) K" |3 W: o' {9 [        if A_i=A_leave then send to die7 K& P6 C! m: W
        else inc A_i by 1
+ H% {4 U6 F! s3 \! g6 K9 V    end
, |4 ^% ~) R( {, K9 Uend3 F! K/ g$ Y4 Q; b

5 o- m' A* l  Vbegin P_pick2 arriving  N' W2 t, l  t+ R
    set A_i to 110 O) O5 O7 u6 i0 V. g$ U5 I' P# B
    move into Q_induct23 q8 P: M8 t6 {3 e( M' c
    move into pickaisle.induct2
# Z+ k5 H6 k3 O1 Z2 m    while A_i<=30 do begin
( Y: r9 p5 }! W        travel to pickaisle.con(A_i)
" R8 L6 W4 ~, S, a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' [2 {" A4 y& N; J        else wait for 10 sec/ }) r# u% a' G8 ~
        if A_i=A_leave then send to die
( U0 N' Q! H& @3 j1 i' s5 L7 a        else inc A_i by 1
! c6 a3 ^% a$ E9 n    end
# I' g! d9 c- U+ g3 Zend' g) A! P- L' S# O# `+ s
& ^; k9 t# f: |* S8 g
begin P_pick3 arriving# f- E; A2 H6 e
    set A_i to 215 i' W( ?8 b3 @4 D& `' k' B
    move into Q_induct3
% F' e9 n- C+ I; h    move into pickaisle.induct3
: P" N& y* o) d( h1 L    while A_i<=30 do begin
  k$ [/ [7 D! u1 h" A/ E! X% ^        travel to pickaisle.con(A_i)- ?1 S5 H# o1 S# x/ m4 w* n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  h# C  k2 z% R2 M        else wait for 10 sec
6 H0 k9 R- u; b; [4 Z        if A_i=A_leave then send to die) l, z: S$ Y5 a, ^3 ~
        else inc A_i by 1
4 ?/ j2 {+ n  {1 ~0 J, x    end  r/ k0 Q! ]3 x- {
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是个什么东东?% j0 A( m& X1 l6 ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  g* X  m; n# W8 E2 j/ v, ^
) m4 ?2 m9 n2 h  r, jAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, y2 ?. V/ Z# X: Y) f# a- d
( D- i+ m1 j- D6 E: T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:6 ?9 Z9 s8 P# `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& O% p( h7 c  h0 z  w" H! B2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 b. L' n5 L% q# k6 E2 A3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 Z! U1 X6 u6 Q# C& q- w2 V
begin P_induction arriving
& a( }1 C: h( K+ v7 R( H7 L    clone 1 load to P_pick(A_induct)! ~! e* x, z9 [2 h" N( ?( v5 V
end最大的系; x/ ]- U8 V6 U! l  h! `
% S, s5 _8 {2 N1 B% l
begin P_pick arriving% Z3 y, f6 n! b2 z! b
    set A_i to procindex * 10 + 1+ V+ Z; n7 o8 |+ o: L+ _
    move into Q_induct(procindex)* E( T$ J; d- D/ N8 f& w
    move into pickaisle.induct(procindex)* F. n0 T' i* k1 K) J& R! w
    /*check the type of pickaisle.induct(i), for your last problem.*/8 N# h& c2 m' @" E8 L: A# r, f1 |
- E  |8 J% t- \# D8 {
    while A_i<=30 do begin
. m; W; F3 }1 F        travel to pickaisle.con(A_i)5 c2 h" ~; Y. H2 A8 T* z8 v( r% n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: s$ L4 F% ?7 D4 u# q/ J& l1 k
        else wait for 10 sec7 ?0 U" g, A3 c( _' Z4 Q; f' a
        if A_i=A_leave then send to die
- H9 B+ E1 |" n+ E2 q) \        else inc A_i by 1
+ l  V9 j5 A% N+ S* }( u9 @    end
+ f% d# }+ l2 W6 S6 ]end1 o( K* J# {9 m* c
9 X6 ?. \6 {6 x( E
其中的procindex为整形,代表当前process的序号。  W- Y& h# o% R; w0 V# [
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-5-25 07:19 , Processed in 0.017864 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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