设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14216|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ a# D& l- s' L/ L# i
; V6 {2 ~6 a4 a1 t我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 g& m4 t, c3 X( n: s/ }4 N$ P

4 K* z+ ^3 G6 S0 [5 Sbegin P_read arriving* a( M3 ~4 t. O4 |- W. C' {, Z
    while 1=1 do begin
+ N1 p" ~! A3 j( s/ j2 j7 E        read A_tote from "data.txt" with delimiter "\n"
2 v7 K8 Z/ O& U' e        read A_time from "data.txt" with delimiter "\n"
! |0 Q5 K- Y4 e; l        read A_leave from "data.txt" with delimiter "\n"4 g8 K6 v" l6 V2 s
        read A_picks from "data.txt" with delimiter "\n"' T) U! ]7 d& ?, l5 C
        set load type to A_tote6 l2 B, D' }! ^6 F; p
        if A_tote="tote 1" then set A_induct to 18 `) t" a! B9 v+ r( V! u
        else if A_tote="tote 2" then set A_induct to 2
7 g: y( T8 B, V2 z' ~" o) a( B            else set A_induct to 3    2 I( c; r+ A: o: V
        set A_i to 0
1 p) j: t, m$ z& ~        clone 1 load to P_induction
. J6 }# H5 ?& u        wait for A_time sec
* c. R9 }, j7 \! l    end9 u1 w5 j# J2 U9 v) t" H- W& d
end
* ]& _/ y% L+ G* d' V+ Z" e6 e' n+ ^5 |$ M+ M' u" I
begin P_induction arriving! D* ]4 h. P5 r" s# n( ~
    if A_induct=1 then clone 1 load to P_pick15 A* [4 w( s# w. ?6 [7 Q* N
    else if A_induct=2 then clone 1 load to P_pick2
8 _+ G; t, M  h5 t1 x3 e        else clone 1 load to P_pick3
$ o1 t4 B+ |% {! lend
- E% E' T% m+ _$ E. g- X
3 g! p( P6 W/ s7 q8 nbegin P_pick1 arriving
6 B- y5 ?' B' F( G3 r( k    set A_i to 1
2 S( l1 c! Z0 |, J# U; n. \6 [7 A    move into Q_induct1
. P. N8 C8 ^& k) U0 o' U$ Q! @+ r    move into pickaisle.induct1
* t' X& V# V6 h: E" k/ i* f    while A_i<=30 do begin
2 g3 m# X9 C* O  e/ e* E. H2 c        travel to pickaisle.con(A_i)
( {$ `, K2 j& t; f6 F5 p9 S$ G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Z2 |7 R. Y" _1 V' \# S, \
        else wait for 10 sec& \3 A% y0 z! _' g1 R
        if A_i=A_leave then send to die
+ `3 e% E8 N3 l( F4 e1 K1 R        else inc A_i by 1
1 Y, F& s' I+ w1 r    end
/ @5 ^4 j( g& G( d7 a! tend2 C/ l4 }7 c$ Z  e& ^/ A% X% T9 {2 Y

7 A* ~3 f  Y/ l) d/ fbegin P_pick2 arriving
" k8 B/ U' K$ a3 U6 _( Q    set A_i to 11
3 I8 A' y# {8 t" d, D4 |: t    move into Q_induct2) V0 f0 Z8 i- r" k0 J5 v7 z
    move into pickaisle.induct2; s, |9 Y, Z( C# s
    while A_i<=30 do begin
8 b) k: H( c8 U( G3 x) M& t+ r        travel to pickaisle.con(A_i)1 s+ e/ N; B. f; K3 o6 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ p/ ?  K. C4 _* E, \: E! w        else wait for 10 sec
" ~; t/ j2 b; d5 [! {        if A_i=A_leave then send to die
2 h, b$ M( v/ o        else inc A_i by 1) J2 e- h7 ?: r6 N: t) \
    end
$ {5 |7 j' J+ t, K7 rend
. p3 e. }1 w! @, ^
* i# x( J4 X7 @/ t) s) E$ u, fbegin P_pick3 arriving
) x/ ^" s9 b2 K+ Y# O9 k$ z0 ?    set A_i to 210 s1 s! h, Q# @. ?3 o
    move into Q_induct3
2 V* X2 Q' E. N2 S  \: n    move into pickaisle.induct3
  t. r- A0 h+ n, e- t' `  k    while A_i<=30 do begin
  b3 p! l+ X8 u0 a6 a. w+ r        travel to pickaisle.con(A_i), f5 ^8 i3 ^+ m9 o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! W4 p8 |1 E) o4 {, }4 q$ T        else wait for 10 sec
) c5 p7 U' Q9 a        if A_i=A_leave then send to die
  b5 E! V' U3 S# a/ i  L        else inc A_i by 1: X3 F3 Q- D) O% X% Q
    end
3 {8 q9 W) \# A: z' ?# u4 c( vend

最佳答案

查看完整内容

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 s; z7 p, k5 c& s" q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( m3 ?& y3 i. q/ k7 x4 @
4 k9 a; n; z9 r# S% T
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! \* p# l& @% P
: M+ C. a& K7 R2 H另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 M$ T4 O* \, V  f' V* f: D' N6 {
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" P# |7 E; r5 \3 ]( _. N2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ r0 k6 f  g, t1 j3 c% d1 ~3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ A+ o% i1 v7 }6 V' L/ E1 O2 f7 Hbegin P_induction arriving. i' u: j. N: w9 O
    clone 1 load to P_pick(A_induct)
/ q0 _$ X: i% a. D9 S: U: Vend最大的系
, w8 u8 G) G- y$ c2 M+ ?$ P! y' s1 T  l& p0 U
begin P_pick arriving& p* j6 O0 o. X  b
    set A_i to procindex * 10 + 1
, R* V( G3 W! V! [; w3 u    move into Q_induct(procindex)
6 G+ `2 b- y: d" C' z) V3 e* L    move into pickaisle.induct(procindex)
# p- r9 ?8 P: D) i, G    /*check the type of pickaisle.induct(i), for your last problem.*/  _8 h/ q& D8 _
$ a* j2 c* {# o$ C1 {4 l
    while A_i<=30 do begin
; ]  y; m  [" Y/ k        travel to pickaisle.con(A_i)
/ x( }9 a  s* _+ a5 O3 C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) X  A# A7 c9 i& A4 r  A
        else wait for 10 sec( c2 A+ [6 c+ ]$ H& a4 Z: a( m
        if A_i=A_leave then send to die
$ ^, }9 s6 o1 P5 T* V% a        else inc A_i by 1
% M2 P7 `4 s. s% }" [    end
/ Z; I* ]/ I8 x! S7 Yend6 ^% V: K1 a6 X( L& w

% i- M. J. i) F1 l% `1 ]+ J5 ]其中的procindex为整形,代表当前process的序号。
8 X9 \. J& y: }0 D6 i9 _& h- 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-21 23:55 , Processed in 0.019574 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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