设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12747|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: O. L- _8 {$ e% H5 m9 T3 R
" k. B! I! T7 x+ j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 Q1 A' F5 n' y

( B  m# J: p9 P# ~begin P_read arriving
$ T+ L9 r2 k0 y( j4 P' Q    while 1=1 do begin
* l5 P8 z! o- N, v; L3 F0 q! ^6 K        read A_tote from "data.txt" with delimiter "\n"# V. B5 Y: {) w
        read A_time from "data.txt" with delimiter "\n"
2 D0 a0 w) C0 W2 s        read A_leave from "data.txt" with delimiter "\n"
0 x! `- E9 }. F( s; b; R        read A_picks from "data.txt" with delimiter "\n"* a& u% c' H7 U' c
        set load type to A_tote- x4 R) r& }* M' N
        if A_tote="tote 1" then set A_induct to 1
3 h9 `8 |/ E0 W' q5 e6 B1 ]        else if A_tote="tote 2" then set A_induct to 27 y2 Q+ ]* r1 ?& M; ~9 @
            else set A_induct to 3   
9 N/ f4 o# \0 S5 P- k9 {        set A_i to 07 {' @1 s7 ~/ w1 e1 S' Z
        clone 1 load to P_induction2 s6 L9 u  t; S  F5 o0 c5 I
        wait for A_time sec
( U% m6 A' h5 d4 g+ ~& I! }' j    end9 S' C6 l6 _" W* `+ B* U
end
5 B/ L) t8 r4 a1 z. _& k
  P1 M; e6 q& R" hbegin P_induction arriving' L( K* V$ b2 ]9 T$ h
    if A_induct=1 then clone 1 load to P_pick10 u; f5 i( |% C( }7 ~+ Z4 |
    else if A_induct=2 then clone 1 load to P_pick2. y, Q: t3 U8 ?# U" c) q+ D
        else clone 1 load to P_pick3
, S/ R5 J6 s. s4 yend
0 E" X8 F! A2 [  B0 y0 M+ ~: H9 ~& V; `( E' Z* P$ S
begin P_pick1 arriving
; D- J3 O5 _4 p3 z, [4 E    set A_i to 1
' u# M! v0 ^8 `3 m    move into Q_induct1
" {( E3 _, @9 w* e. Q2 t    move into pickaisle.induct1
8 P! N$ ]( l* e+ a! j' U- I( x9 u    while A_i<=30 do begin
$ W: }) w( g2 l        travel to pickaisle.con(A_i)
+ M7 V4 C  b6 f  s4 ?        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* \; P2 A; B4 [; n9 q* T& X& N4 B        else wait for 10 sec! E3 y* j( K3 t: r
        if A_i=A_leave then send to die3 O( J$ ?2 c& ?: I$ Q1 ?5 e
        else inc A_i by 1
! @) E3 W' e# X# v; V    end* g8 t/ g+ I9 r* T
end
5 d, I; F7 C6 R% ?0 [
4 Z) L. [8 {- X7 n% ^5 |begin P_pick2 arriving
# ~& i# c& B4 T4 c7 x    set A_i to 11
% Y/ w# g2 A- o    move into Q_induct2+ M% b, R' h& S- s% t1 z0 u+ X
    move into pickaisle.induct2
: R4 |0 ?$ v5 U. `0 V% {! J' w    while A_i<=30 do begin# T6 r; m5 {8 s. S* o) q
        travel to pickaisle.con(A_i)
( c! O! b9 r* o, n+ d6 S4 L# j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  G/ @' j7 O0 Q" m. h. n0 l
        else wait for 10 sec
  v# m/ G  _, o4 S        if A_i=A_leave then send to die' k# O! Z6 e, m
        else inc A_i by 1' B+ n8 Q2 W& X! E% E# S  [- {
    end$ p4 x8 ]- j* M3 X+ l
end
, e9 L0 M" W8 e$ E& r8 c% Q/ X
0 t: @0 l, ?# l8 D& e- _# m2 jbegin P_pick3 arriving
9 @  D/ ]( z9 Q3 n; K9 g    set A_i to 21" R" S8 t3 A! K$ U
    move into Q_induct3
; B' R- A/ P% t; J: ?    move into pickaisle.induct32 \/ f# R, X5 S# V; p3 u0 F
    while A_i<=30 do begin
. K3 }4 P4 @( @8 M+ Y        travel to pickaisle.con(A_i)
' q5 M6 [! }3 o) K6 F0 R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* O( j/ r4 C0 s* @% w
        else wait for 10 sec* F$ M& f1 P; n: ~
        if A_i=A_leave then send to die
' W  Y1 X+ \. a4 D        else inc A_i by 1$ h" X3 V' d" [# b
    end
, O% G/ B  ?9 P( c9 C  a5 [' ]$ r2 lend

最佳答案

查看完整内容

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是个什么东东?/ d& l9 x1 }9 F7 j4 a9 G' V# c6 S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- Y, T1 {" ]  v; O& R; ^
: W4 @/ B7 X# _7 V' L" \, z+ L2 J
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. E; S3 f: T+ o) x" Y4 {
% j7 w- B9 @  u: M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 |% ^0 j' j3 S1 Z9 H# {/ s4 ]
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; y# R5 D0 m" h0 @+ p( D6 c( X2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 f# l" b+ u5 S/ ^" u; }3 e2 t( ]/ J$ e3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 |) N. R  m3 @0 p1 V) [- I0 }
begin P_induction arriving9 U) s: L6 I, w8 t  a1 y* H8 Y. O
    clone 1 load to P_pick(A_induct)
, o* u" h3 y, n* S/ P! @7 eend最大的系
& _: q  [8 c4 ]( r% o* R* |) ]& E; U. g
+ ^% S6 y( m* r  B& Y2 K, |begin P_pick arriving
0 G2 u7 i# \9 K% O' D% |    set A_i to procindex * 10 + 1
" r& S2 K) x, j& I    move into Q_induct(procindex); P4 w2 G% G  }" L7 U: E
    move into pickaisle.induct(procindex)
5 c+ Q- E" T- K  [& e4 ^4 P    /*check the type of pickaisle.induct(i), for your last problem.*/
& q" z, R7 G5 R" u9 w( v
  c! h& I2 D% D. X    while A_i<=30 do begin
+ e& n9 N# M" Q/ K3 P" q9 _0 U        travel to pickaisle.con(A_i)7 u4 z1 c+ B( r# a# \% s9 @2 B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& e) [. V% h7 M1 R& }* U" j  \  d        else wait for 10 sec
, N; `8 L& b. M' s, z        if A_i=A_leave then send to die
( ^) F0 s% c- r' g7 l) w        else inc A_i by 1
6 S0 j" \' `# `    end$ c, s, l/ A; i2 x2 R! A
end4 [( A) [4 |$ p: o
* D, V# k. R' x7 y, M
其中的procindex为整形,代表当前process的序号。
4 Y4 @) m4 T( b3 Hstation和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-2-16 22:56 , Processed in 0.016732 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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