设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12786|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ r$ b& F4 u5 z# G9 ~
: c& Q$ Q0 `1 I% _$ V) k" 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中的数值,不知道会不会有什么不妥。
( e, ]" T; ], j. w& a! d- j
4 r$ @4 J6 p/ H; ]begin P_read arriving
; G2 t9 e. v$ d5 d    while 1=1 do begin* ^3 u- Q7 {/ E. V0 Y. x
        read A_tote from "data.txt" with delimiter "\n"2 R( o' A! t* p- G! k% b, f
        read A_time from "data.txt" with delimiter "\n"
" ^6 N2 f) k- ?* ?        read A_leave from "data.txt" with delimiter "\n"+ ~8 {$ o  l. `9 _; I/ x4 @
        read A_picks from "data.txt" with delimiter "\n"" l- W9 K* W1 \5 [" u8 _, z
        set load type to A_tote
1 t1 o& Z- f% ]; a; V        if A_tote="tote 1" then set A_induct to 1( i* s& \6 O$ ?; y$ m
        else if A_tote="tote 2" then set A_induct to 2
/ W. I/ Y0 Q" \* _. Y0 @0 n            else set A_induct to 3    " m( q( {$ @: m% @/ W1 F' o
        set A_i to 0
7 X$ \. J0 U9 z0 I$ Q        clone 1 load to P_induction$ w& v1 |9 X5 `- i; _
        wait for A_time sec
0 L) W0 M  ]+ m' R) ?8 c+ m+ W    end, E( S- K2 f+ B6 b3 q  V
end
% a, U+ a- R, B: x; X5 l  _, Y0 e. X, `+ N' c' w9 Z6 [
begin P_induction arriving
# E0 }* B; q0 T$ h& F% F    if A_induct=1 then clone 1 load to P_pick1
0 S% V6 r4 C( z! ?9 \    else if A_induct=2 then clone 1 load to P_pick2; z4 v! x; ?) M- L2 _
        else clone 1 load to P_pick3+ ~8 I1 F# O4 ?: w0 u
end
- n' k7 C; h0 i1 g1 u4 b) s5 K! K4 l3 ~1 @6 @! i1 c* }
begin P_pick1 arriving
0 C4 A0 I' P; V) [5 X% R2 c    set A_i to 17 W6 p$ e' \9 i) Z
    move into Q_induct1
8 O5 I: j1 f2 d. M  V    move into pickaisle.induct1
+ C* n! e2 o% J$ w. ?. P  w$ R    while A_i<=30 do begin
! t- w9 u( j: h% f7 W" ]        travel to pickaisle.con(A_i)
. N: f* z7 l8 ]+ G. r        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! M! a  S$ ~5 r
        else wait for 10 sec7 x/ o+ q! j9 u' a& O2 G- W* z
        if A_i=A_leave then send to die
6 h- @: I3 d; E! j, v        else inc A_i by 1
+ o% E  y+ ?6 D$ ?, q& X    end
: r% N9 T7 t, `4 }* [end
; `! M# [$ J* V( @$ N7 I% \  s
" f$ W: \8 ^2 t) m( D$ Sbegin P_pick2 arriving
: E! B; R, {& C7 s    set A_i to 11" u9 U' M5 w3 U+ u
    move into Q_induct2& r8 a. S$ C! u
    move into pickaisle.induct2, ~" T4 R6 K/ i& E+ K9 d
    while A_i<=30 do begin  m* z- D4 |) F) t
        travel to pickaisle.con(A_i)( n) w. y$ ^( I1 H/ W) e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# E" r- [6 I5 M0 @& N
        else wait for 10 sec
* `1 Y+ |1 E7 a& x8 Q) E/ ]        if A_i=A_leave then send to die
8 o; q4 U8 Y: J& i6 {8 q        else inc A_i by 1
' V8 H, B( \9 r# f( ~    end
4 o4 O  O8 A, }  Zend4 ^0 s0 p( c6 r- f1 C, P
2 P6 T2 B% R/ q$ b  B' a
begin P_pick3 arriving
  P) v% u; {( l    set A_i to 21
3 T2 i8 f$ A: G" K! s5 M! j' i6 e% q& q5 K    move into Q_induct3
1 k( D, ]* n. r. G- G+ R    move into pickaisle.induct3
. P" c$ I1 j# m& T4 r4 b$ F5 E    while A_i<=30 do begin
7 d* R$ P& ^# A1 `- x        travel to pickaisle.con(A_i)
; z9 M  t; C6 m0 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ f, M7 D7 O+ R. g" m, G9 q( a
        else wait for 10 sec* U  P# a3 m/ \, F/ J( ]
        if A_i=A_leave then send to die) h4 [: z8 T! W' O
        else inc A_i by 1. k: z- f* C; A, r; I
    end
$ D7 c; K9 c' @4 u2 G9 w  |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 Q: k* I" [# q1 Q) P0 A7 U2 c0 ]move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- ]: P! R0 A3 R9 G. z2 B, y) V) y$ r+ t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 [0 w1 V4 I/ v( s! t- r2 z8 u, N2 ]

# @2 @% \  A$ [. _另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:7 a3 A$ H/ E' N- y* {( |5 h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! n+ c$ M3 S' T) F0 C" @0 [4 q- \
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
: o+ @+ u0 ?4 g. z/ p" i0 k3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:" W8 w& v: Z# E: V2 k1 f1 i8 K
begin P_induction arriving! n0 X1 Z& W( K. J
    clone 1 load to P_pick(A_induct)" P9 }5 j- V) R& W4 t
end最大的系
# t2 _% l$ Z+ a4 n8 A  I' P" H8 _6 C! {) W9 }: F3 Y
begin P_pick arriving
- G3 `0 F; y$ q( q! R    set A_i to procindex * 10 + 1
$ U% a& M" r- X4 ~# O" S9 e" b9 z    move into Q_induct(procindex)
( I# H& M( o% H    move into pickaisle.induct(procindex)
; [+ E( U. U2 O# E    /*check the type of pickaisle.induct(i), for your last problem.*/
1 ^3 }0 m6 ^& m( |" T; ]: G, m% \% D# ]
    while A_i<=30 do begin
/ E* j7 {: w) J, L        travel to pickaisle.con(A_i)8 {  h* F" u3 u% U: k. Y4 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 X9 l% u% x( e2 m" C/ d& O3 I( [
        else wait for 10 sec. @( b2 C* V: `8 C8 M: i
        if A_i=A_leave then send to die
! F  P# C0 M$ F1 T1 k( V        else inc A_i by 1, s6 e  J! Y! f" O3 D' A+ I& x
    end. V: ?% J; U) h  D9 M
end
9 A) [- b/ A; W0 Z& y
6 i1 [; i; |5 v3 ?0 P其中的procindex为整形,代表当前process的序号。% Y6 S' T, b; d7 Z
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-2-20 22:28 , Processed in 0.019919 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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