设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14573|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. Y2 ]# F! k0 b* I0 u# _4 N" X+ A* z7 ?& Y' X8 ?
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# D: P* P4 v  Z$ Y& Z- o* ^5 D
9 t4 i, ]& n' D) j, f0 q- bbegin P_read arriving
& R0 ~7 a6 j! n+ d7 @/ P    while 1=1 do begin
8 z3 Z$ Z* ~0 I( X        read A_tote from "data.txt" with delimiter "\n"/ d- g3 m, }! ^0 w- D5 g
        read A_time from "data.txt" with delimiter "\n"" P: e/ ]1 U0 S% k
        read A_leave from "data.txt" with delimiter "\n"
/ ]( M4 ?' k% @% f5 n        read A_picks from "data.txt" with delimiter "\n"
' S" r9 C9 Z) |) c9 H        set load type to A_tote
3 O  I8 D2 {# i* @4 i        if A_tote="tote 1" then set A_induct to 13 B7 U. J0 ~. g" S
        else if A_tote="tote 2" then set A_induct to 2
  c  I  e& e- V' z            else set A_induct to 3   
; z1 W- S& S  Z/ ~        set A_i to 04 W2 O9 S# X% V. k5 ?
        clone 1 load to P_induction
  ?& z- U8 x/ j        wait for A_time sec
0 q$ g& H6 \- |) K    end. R9 S" a) R" p* [% V: C
end
3 B/ O. N% I9 Z1 @9 U+ u; M. p2 _2 W! x6 i) a
begin P_induction arriving: V6 t+ B1 n) T& c# W- M1 y+ Z- Q* _
    if A_induct=1 then clone 1 load to P_pick1: `) I- u7 W, h
    else if A_induct=2 then clone 1 load to P_pick2
6 M. x. S1 C  e  t- I2 M9 ^        else clone 1 load to P_pick3; `2 f3 r- W+ k
end$ p6 A% ?" J2 u9 |) ~

4 E# t+ Z* u$ m6 Zbegin P_pick1 arriving* [5 Y2 m3 T( i% n
    set A_i to 13 S' H' l" u" F1 c% g& _
    move into Q_induct1
! t6 v4 a. [% Z6 X    move into pickaisle.induct1
7 f8 F3 [" L1 W& J    while A_i<=30 do begin( r' v0 Q% a1 O
        travel to pickaisle.con(A_i)2 Q" L( I$ Z5 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. \' L5 ]; `0 M
        else wait for 10 sec
* n5 p; X9 S, t8 T1 q' c        if A_i=A_leave then send to die
; |7 o3 \( O. E1 Z& f        else inc A_i by 1
% P5 h1 V  t( C1 D1 b    end& u6 V! @$ O3 n& l/ [2 s5 e6 B$ U" U
end
' i) R! ?- n6 q0 P- U7 u1 x- v$ m. }' m" J. O, ~8 y
begin P_pick2 arriving; p" V0 z. g$ E" a! i3 m' ~: X
    set A_i to 11
; V$ U* g8 u/ C    move into Q_induct2
" B7 @# ]; u0 }    move into pickaisle.induct22 B9 h1 A9 s: f! M# z0 f! I8 s  T% N5 k
    while A_i<=30 do begin
! e& ~  m- I6 i+ ~6 G- ?        travel to pickaisle.con(A_i)( ~3 H+ v; f2 X1 r/ R8 K( i$ t  P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* d% H& [, T  R4 g9 ?1 b        else wait for 10 sec
- c+ ?! W7 r- p( \( E  f: ^; w        if A_i=A_leave then send to die
% J3 `' R9 K/ W& O4 _        else inc A_i by 1
) j* `4 t% i5 \! q2 \; N4 V. `0 k    end; |9 U5 p  D: U$ ^' Z1 Z
end
3 k/ z) L  w" M' ~' S! n6 s7 y) g' `3 J* d
begin P_pick3 arriving
/ ?7 b% l; z( z1 S7 d    set A_i to 21
9 f" s- {8 x  _5 {    move into Q_induct3
* v, t! F  b) b1 S, K/ s$ c: f    move into pickaisle.induct31 O9 ?8 a: b) r1 q( |9 v9 S4 }
    while A_i<=30 do begin: J5 e0 N4 S* {; h" }7 i
        travel to pickaisle.con(A_i)
. H2 E) ?. O9 ~. z5 ]4 ~2 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; j' l( T+ x, g1 h7 y- b
        else wait for 10 sec
2 I1 U+ z8 s/ j  C        if A_i=A_leave then send to die
) Z; z5 P. B+ k9 n        else inc A_i by 1& O4 R5 P, M5 H. E3 Q- Q9 ?  L
    end
+ _# t' v! H2 v3 }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是个什么东东?4 M& M6 I% S4 X; G+ N' o* q+ ?% {
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ {( J+ m1 x' X' Z9 L
; F2 N1 C- K+ V- q2 O  @* W
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
* C" M# b' R. s4 p8 t
: [2 S1 c9 c6 V/ `  A/ h另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ `& M3 I/ I: _6 J
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 F9 t& w) g' l4 ?( J* e( v. U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' |( j" a5 Q, D8 |+ e; z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; B$ G+ ^1 {8 y* tbegin P_induction arriving( ]8 m* I1 S) j0 ]) [* G+ A. e
    clone 1 load to P_pick(A_induct)
( G& S6 V9 K) q1 Nend最大的系- h4 E( V; I+ n& ], Y0 M& \

2 j: G9 K2 D$ a  s* Y, Q3 Ebegin P_pick arriving
& T% I* @9 N6 F4 f    set A_i to procindex * 10 + 1
3 ~8 }. l) ?$ ]8 ^, }+ S, z1 V    move into Q_induct(procindex)+ W; g1 R6 m6 \5 @* ?. |
    move into pickaisle.induct(procindex)
+ `- u  Q- h, I    /*check the type of pickaisle.induct(i), for your last problem.*/6 N5 i5 a! I; B: r7 r

: P+ P* ]# ]' e2 I0 b    while A_i<=30 do begin0 _# h- B7 g; W+ f/ }
        travel to pickaisle.con(A_i)
% r2 r- u7 N8 V7 Y2 Y/ v3 f4 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ~, n+ b/ o. ~
        else wait for 10 sec
# f2 I" y* k# |+ g  s/ {( i. @        if A_i=A_leave then send to die# t7 u# g* y- Z4 q! U* a/ U; M
        else inc A_i by 1
( @1 T$ X6 V' d8 N    end7 ^2 j9 n* m$ L  [4 x4 u
end
) f0 U$ E: j/ w3 z# @# q4 Q6 l) [" F. Q3 Y6 _
其中的procindex为整形,代表当前process的序号。7 ?6 Q1 s5 I& \9 Y: T/ ~
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-17 12:44 , Processed in 0.014584 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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