设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14085|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 }- ?: r* T. s0 b. I! a) F; j' e/ V+ u4 f+ u( p- d  [5 S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ^$ }3 W$ L# p2 S( A$ K- [& h8 q1 t+ g' L) U; e) R/ j; y
begin P_read arriving: n. j; `6 @7 v* M
    while 1=1 do begin
6 u' @7 u' \+ ]' ]& l% r, P( {! A        read A_tote from "data.txt" with delimiter "\n"
4 {4 V0 ~6 L3 y! ~# k6 _$ N        read A_time from "data.txt" with delimiter "\n"
# \3 j& J& }$ E2 i        read A_leave from "data.txt" with delimiter "\n"
. [$ E, c9 d7 c+ {        read A_picks from "data.txt" with delimiter "\n"& K! x$ b2 P, O
        set load type to A_tote
5 b6 J; P# k9 V1 S        if A_tote="tote 1" then set A_induct to 1
: ]+ H5 j+ ]. w2 m' u( R# G        else if A_tote="tote 2" then set A_induct to 2  P  m: k( _, V) y2 b+ n4 |
            else set A_induct to 3   
2 A  M7 i* B7 B7 |- P        set A_i to 0
6 |; c6 _& E( Q, Q9 L        clone 1 load to P_induction
! c6 H3 ~( H5 A3 f. @        wait for A_time sec) U. e8 c9 H& z
    end
" a' M7 p4 r, oend
+ f: \: k6 d$ T( O; v3 W; G. _- _) Q& m
begin P_induction arriving' s. Q& z8 X/ _9 S3 R
    if A_induct=1 then clone 1 load to P_pick1
% W; o: ~! e- J& r/ }; \    else if A_induct=2 then clone 1 load to P_pick2
7 p. ]2 G, M. T        else clone 1 load to P_pick33 D7 Z+ P" R4 t: z0 [
end
! V; ]* j4 w& ]# Y5 Y3 W8 X
2 g5 T. {$ C! Y1 }: Cbegin P_pick1 arriving5 T: a- ?* x! i  ?# u! o
    set A_i to 1
' N; e8 g5 _8 M) h9 {& q    move into Q_induct14 W  y6 s9 e+ l" g+ t6 F  X9 E  b
    move into pickaisle.induct11 c% i$ G+ L) I
    while A_i<=30 do begin" v. q0 K- X4 f7 c8 {! k3 l( P6 N
        travel to pickaisle.con(A_i)& c) L; k" \2 y) i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! k6 Q: b/ t% _1 E5 {
        else wait for 10 sec
6 F; }, ]9 ^5 W% y4 h3 _        if A_i=A_leave then send to die1 h- X0 o" G6 g0 M3 c9 u
        else inc A_i by 1+ T  p9 B/ Q7 o3 ?" F
    end( @7 ^- X$ f3 M, j4 Z% s0 B/ v
end+ j/ r$ a8 ~; P9 @

% ^' [/ l$ L, A. h! S  hbegin P_pick2 arriving  W, ?) g3 M. ^- |. W1 H
    set A_i to 111 f! M+ ~. X2 ?# K6 R
    move into Q_induct25 H" ?/ J4 ]) @( [, T( g
    move into pickaisle.induct2' u4 f5 G  c3 ~4 G: l
    while A_i<=30 do begin
  ]6 C# S7 u0 \  w        travel to pickaisle.con(A_i)
/ b: Q7 T' w% g' `0 P. x2 G6 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; ~" ^1 ~4 O9 E: u9 Q
        else wait for 10 sec# G2 ?3 o' N& ?/ X7 z. d3 V
        if A_i=A_leave then send to die
  n4 S$ ?3 E' M3 x  \8 T        else inc A_i by 1: I% L# l+ ^$ [) x% h. K
    end
9 K2 P1 T( ?; d* Dend
' b, L% m9 E$ U+ Q8 v; ~- \: H- v/ e8 I5 K' p& p3 s+ B7 A3 N' [9 W
begin P_pick3 arriving& ~  F  d* q5 [0 ]
    set A_i to 216 u/ I% c+ o/ J- F' P
    move into Q_induct3' W* |. U0 C# L, u" k
    move into pickaisle.induct3( v! E/ e" ?- u9 @8 I$ V& e
    while A_i<=30 do begin
$ T" z/ n; _' }        travel to pickaisle.con(A_i)$ ~: }6 Q( E$ i: o$ ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; `; K! P1 p* k: X" }" }- i        else wait for 10 sec! @1 W& L  \4 S3 c* t4 R. \0 t" u
        if A_i=A_leave then send to die
. g  i; K6 G# k, U4 }! B        else inc A_i by 1! t5 p4 w* O5 G  J, R
    end- g! N0 ]! l$ Y
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是个什么东东?
/ ~8 {* I7 C0 `! ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" X$ Q3 q2 ?% O+ x2 r. }/ E
4 @* [: |6 L# B) R2 [AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 X7 z+ j9 J3 j0 d, l/ R5 z
4 u" t& _5 A( @3 S6 F6 E- E
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! A  ~* E5 j8 R0 q6 G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 z* C$ Q! `# Y/ K9 m5 ]5 u2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- k$ I2 e) u0 E. I: p% z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 y" o) O' P; @+ X' `+ [) R0 kbegin P_induction arriving
2 x2 n: J' Q& ~& K    clone 1 load to P_pick(A_induct)" s+ r" U! y  F3 V! G4 c8 [
end最大的系
; k3 |& w5 [! ]& S( I4 r$ U
* c2 j4 o! T1 Cbegin P_pick arriving
( I, k* I. _, W    set A_i to procindex * 10 + 1
& _; }* ]" J! u1 U. N    move into Q_induct(procindex). N3 W0 M) e$ _" Q5 s" F) F
    move into pickaisle.induct(procindex)
+ }3 q  a  i6 j% U: x2 b! Z% {    /*check the type of pickaisle.induct(i), for your last problem.*/
" D; G* V1 [3 R- N% Q4 s
% f, @2 d& j/ Q" p" E0 v8 W7 F    while A_i<=30 do begin
+ D4 P9 o  m) t        travel to pickaisle.con(A_i)8 ?) P: D+ s( k. r" R4 T6 s  e. }7 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" N& Z* K( n* @/ a" f1 f: `
        else wait for 10 sec( r* j9 w! _. R3 K
        if A_i=A_leave then send to die9 E3 T& V& {6 E+ [5 x8 R- n4 c' o3 L
        else inc A_i by 1
/ W/ z$ F8 v! p9 Q) S- d    end( c5 f, w$ R( K9 s( f
end  [& F: n3 c& M+ _8 X
5 z/ g' Q! `, a  C" m& X, n
其中的procindex为整形,代表当前process的序号。
& n; X4 E. {6 ]. j9 `: q  `5 o) o0 \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-6-7 06:14 , Processed in 0.016612 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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