设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15036|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" J0 M' Z" G1 n8 _# B: k( t6 E

+ W% A( a/ q0 U8 `4 d4 R  ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。- h$ h6 J* c% {2 ?% P( [

% m, @  }5 |' i( D1 q0 l+ M$ Sbegin P_read arriving
+ u  C% _' e5 O0 K9 ?- i  ~    while 1=1 do begin& A+ }  v$ q% A1 v
        read A_tote from "data.txt" with delimiter "\n"
3 _2 P* V( u! u; V3 J7 g, m        read A_time from "data.txt" with delimiter "\n"
. Y: G0 D) r( L3 R- f6 ?( @" R  \        read A_leave from "data.txt" with delimiter "\n"1 W% M3 t' R3 ^7 j
        read A_picks from "data.txt" with delimiter "\n"/ y8 H3 E) Z5 O; n5 \" x. a
        set load type to A_tote9 J9 J, |8 q; C3 {+ _, B
        if A_tote="tote 1" then set A_induct to 1# q9 e9 c: s/ G$ g0 @3 ~
        else if A_tote="tote 2" then set A_induct to 2' \" `; ]+ r5 i
            else set A_induct to 3    " s! }1 _6 \- G  v$ Q6 u( k1 \1 m
        set A_i to 0
6 n0 k, u7 v, r  ?. S" C        clone 1 load to P_induction1 @( B, y& `  ^4 D
        wait for A_time sec
: k/ i6 a9 J7 K    end
1 J( q5 A2 q+ Q- U5 v0 ~, Nend
9 F" W& Q2 G  @3 K, J1 N* d8 |% g9 C$ T7 o
begin P_induction arriving  R4 J( i8 j2 P4 R; I& K- H
    if A_induct=1 then clone 1 load to P_pick1. r6 G5 `; f5 k4 i
    else if A_induct=2 then clone 1 load to P_pick28 k8 u) P9 B1 ]* S. A5 |) m
        else clone 1 load to P_pick3- a) r* D; n8 u7 M
end
3 |$ j$ P( L9 w
  S; ^- {, L2 ^! ^* _$ K% Nbegin P_pick1 arriving
/ M" x6 ?% G4 h% [9 T! @; \    set A_i to 16 q' {2 M5 P% n) _+ s, E
    move into Q_induct1
6 a: [; j. k* {( P/ m, c7 t# u    move into pickaisle.induct1. p: j8 q. m% |$ n! ^( |  w
    while A_i<=30 do begin6 \4 d+ Z1 p% z7 s; W: f
        travel to pickaisle.con(A_i)- H. ?: t! C& r" E1 n% m* A- |- k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 w. t2 }0 w; a  I$ O        else wait for 10 sec! @! M" P, R2 e# V# \/ v( d7 F
        if A_i=A_leave then send to die
6 H7 M' }1 w" x! F        else inc A_i by 1
, Q0 a! W, w# p8 A* m7 G) _; ]1 Q    end
7 B8 V! w5 C, `$ p5 Oend
# U) o- C+ {. _. f6 D' _! e. t
4 ~" o( E2 \+ K& y# bbegin P_pick2 arriving
  {- N1 {9 i) T    set A_i to 11
' n0 ?% e. F% \; S, k    move into Q_induct26 P- }) B  p% D  n8 a5 @
    move into pickaisle.induct21 \/ p6 p9 j. `7 M
    while A_i<=30 do begin7 G' j$ C' c, U' O
        travel to pickaisle.con(A_i)2 y7 z) u- q$ ^  ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 m$ J* ?) O" y1 {. R! e
        else wait for 10 sec
) K6 z, C2 Z  f" `+ \        if A_i=A_leave then send to die0 p/ l- t7 z" D' f
        else inc A_i by 1
7 s# e8 w0 ~3 Q8 B+ L    end$ N  ~+ k9 z- I6 \. X
end
6 K, _# K- v3 h1 p. H/ m* M1 @: U' \7 I. Q9 S: C
begin P_pick3 arriving
2 y0 d: F8 n; Q0 M$ _2 v    set A_i to 21  G4 l6 u# X% i$ y6 ^0 ?7 i
    move into Q_induct3
& g% @, q( z) _% K' i    move into pickaisle.induct3' V. k3 K4 Y0 X4 c
    while A_i<=30 do begin* h% k! H# D. V+ B
        travel to pickaisle.con(A_i), ~  p% I9 s' J" D7 d9 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" ^4 v6 }6 G1 ^
        else wait for 10 sec
8 j# L6 u3 Q- V$ E) w( B        if A_i=A_leave then send to die* Z0 S, r; u0 ^6 _2 k+ l
        else inc A_i by 1
) O' U. U' Z) L- q    end
2 m- J. q! P7 b0 l! ?% ?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 N6 o+ [" \$ ~" L
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
6 K) \1 O# q, d! q% f
% r# C: b$ O9 T( l+ T3 s" NAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. l: j  O6 v$ L/ T

2 T' q8 E. O# |5 J8 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! l3 B+ R# W6 q" i
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' h8 s8 U2 f( N& H( {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; b0 l" K, I: x) @2 ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:! B/ B; l" W( _8 [- l
begin P_induction arriving- M) ]! n8 |6 e# {
    clone 1 load to P_pick(A_induct)2 \2 Q7 b3 E. O, n. k4 O; E% {2 O- q5 }
end最大的系' O7 h$ V# l" |# L

9 _  g2 o% j3 bbegin P_pick arriving+ B5 p$ r! g; L, y
    set A_i to procindex * 10 + 1
+ H. @' l  e! u$ b, y9 h7 I: [    move into Q_induct(procindex)
# c$ {* b; P% }' {8 B* k    move into pickaisle.induct(procindex)
1 M( j9 U# G9 B5 g    /*check the type of pickaisle.induct(i), for your last problem.*/: s- v$ {5 t* X. e' @+ B

: v0 j7 o" T, i/ B- M* i$ o+ w( a    while A_i<=30 do begin
3 m$ C$ D, c& Y        travel to pickaisle.con(A_i)& Y3 {* E$ L' O/ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 r- d' _1 }3 q* C  R5 G  G- a8 u        else wait for 10 sec) D" R" q% h1 A4 R
        if A_i=A_leave then send to die/ Z/ w: f; a. z
        else inc A_i by 15 p' @0 Z& z/ l3 z, n
    end& W  B3 u9 b- C7 j& L$ r
end+ v4 Q# B, Q, m6 _: {( T0 i
/ o' O' {, v2 i& L
其中的procindex为整形,代表当前process的序号。
( X8 X+ O* a3 k( Tstation和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-8-5 14:54 , Processed in 0.020320 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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