设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14468|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( t9 ~6 U$ j" B( U
3 M/ T, ?/ v3 I我的问题是,在每个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中的数值,不知道会不会有什么不妥。% b$ P& E6 g. o1 W! |/ T' I4 ]
! x2 n  B- k  M" |$ k! O; d
begin P_read arriving: E' R2 q) I$ q2 S$ m
    while 1=1 do begin
* e% {$ }! Y$ p( E& N6 G3 b  ~        read A_tote from "data.txt" with delimiter "\n"% o8 n" F. v! L" u# _
        read A_time from "data.txt" with delimiter "\n"1 @4 _+ f$ u4 x9 U1 y
        read A_leave from "data.txt" with delimiter "\n"
$ Z# D4 Q" F# z* U+ A; g" B        read A_picks from "data.txt" with delimiter "\n"
1 F8 [( S) Z" N7 e, Y1 o        set load type to A_tote
$ ^, G* U) Z. B! z/ Z( j7 |        if A_tote="tote 1" then set A_induct to 16 ^) a  l7 X) t$ L' A/ x& Z9 v
        else if A_tote="tote 2" then set A_induct to 2. R7 q' O6 W  O% {* q% k
            else set A_induct to 3    % Q# d, l: M5 _% ~4 i$ P- M
        set A_i to 0- N0 T3 N+ u% `( E, D0 x
        clone 1 load to P_induction) _( H2 |3 F# Y* C: Q: }
        wait for A_time sec
- `7 _, @" C! X5 j! z8 g* O    end! ]% t8 ~) `$ I8 Q7 q0 p
end
! c, r, e. }" B+ i4 ~6 l+ p; U
' A5 j% L0 @  X. zbegin P_induction arriving
; B" Z, p$ `& F' r9 m* m    if A_induct=1 then clone 1 load to P_pick16 D+ h+ ?5 f8 C8 N1 V; O& F# X
    else if A_induct=2 then clone 1 load to P_pick2$ F" A) l8 f$ U" [4 L6 l
        else clone 1 load to P_pick3- ]) P3 R1 V, k: T5 B- f
end' I2 \) x+ j; x. ~) x, O3 i! y

# W8 w" R3 a" R+ _+ pbegin P_pick1 arriving
. q6 l$ u: H- D" ?7 n    set A_i to 1
" x( J9 ~3 b2 u! v! }0 v! p    move into Q_induct1: ~# W( A" `0 x. B1 h+ J" g/ \8 w
    move into pickaisle.induct1
" {- s' m2 G9 R4 Q6 t    while A_i<=30 do begin
: N8 Z! \7 s7 S1 c  R1 w        travel to pickaisle.con(A_i)9 P$ v3 ^; p: M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: J8 c7 K! E" X* @2 `        else wait for 10 sec
5 w# ~' @8 i1 B/ f        if A_i=A_leave then send to die
4 M: ^1 E& Q, k8 O1 C7 {        else inc A_i by 1
0 f# o. y5 e. Q2 j: m  l    end
, J# D" N9 U6 A4 ]: iend
7 C9 m+ Y2 p/ o4 T3 S
' e$ A* j- P9 C6 b; ebegin P_pick2 arriving
/ y4 {1 z! K! |5 t    set A_i to 11
% S# p! w6 W! `! a$ M( _    move into Q_induct2# Q, J# O$ u/ n
    move into pickaisle.induct2
. a4 a7 P6 Y0 z    while A_i<=30 do begin
% }) X: S; k, T: k        travel to pickaisle.con(A_i)
1 a; C; X) R2 b& W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ @: U; V: U1 z( B  L+ d; U
        else wait for 10 sec
( J; Y$ S8 N8 g$ @6 l4 T2 T5 m        if A_i=A_leave then send to die/ O0 W  ^* r# L7 W+ m3 [& }7 `
        else inc A_i by 1
' z/ G7 E+ {, ?  k* r: a9 f0 y    end
0 C- i" v+ p# L+ }end
& ]: x) l5 q: [7 z
( a, Y( |1 p- s( ?begin P_pick3 arriving
+ ^8 k6 [' M9 J' T    set A_i to 21
0 v4 |- u; o( C    move into Q_induct3
0 y" r  \' D$ k" n& n    move into pickaisle.induct3
1 q; b- d& O7 f/ }3 v4 q6 R    while A_i<=30 do begin; ~6 Y# Z/ [0 `" u& c( K! a
        travel to pickaisle.con(A_i)
5 {- i& g0 [1 Y. W: ^# W7 v' b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 }- \( ^* ~6 e# O        else wait for 10 sec
) W& q. K+ n+ i5 a0 k- h        if A_i=A_leave then send to die
; X! E+ T, t$ r- B0 t) L/ N        else inc A_i by 1
/ g; `# A: J* L- A5 Y6 m+ }    end/ F) P. z# w" g* {) Z- }
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是个什么东东?$ N7 K+ b; c* K% Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& `9 q4 l; L3 o" S

1 a3 s* C" x) @# UAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
: K! A' N6 r+ B% n/ x
7 O& S0 f0 o8 g4 U1 _# |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  _7 ~& s% T  l$ ^; {' T1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& @+ q3 v& T/ S4 E& F6 N
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' P: K/ ~* \; m/ b3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 ^3 O8 K8 z0 f& A. b' Z
begin P_induction arriving
" ^5 _; ?! ~% G5 R" E3 w$ r; D# b    clone 1 load to P_pick(A_induct)3 B3 G0 p5 J+ y  y- o
end最大的系
4 h2 C3 L+ }  A1 }
1 ~6 }" x# S& x1 m! Ybegin P_pick arriving5 B3 g' @% k( B) D% _# |
    set A_i to procindex * 10 + 1
) ^  }( c: d) l  b, A, A    move into Q_induct(procindex)
+ T; v. o4 q% k1 F4 R( B    move into pickaisle.induct(procindex)
2 W" n9 A, k; ^6 x. J8 y1 I    /*check the type of pickaisle.induct(i), for your last problem.*/0 y& g9 ~' N5 E  k7 t
; b$ a  _% a/ ?
    while A_i<=30 do begin; g. T. f3 o+ P& x3 s4 k
        travel to pickaisle.con(A_i)7 Q0 M9 `. f5 T5 x$ {1 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ n, ^* A2 M- f# j$ l6 v        else wait for 10 sec3 B# d4 d" V/ ~# |# n2 X
        if A_i=A_leave then send to die) f4 V& G* Y: e, T  ?# s
        else inc A_i by 1
) i6 P8 z/ h8 G6 O8 c6 R& P# T    end
7 J' e7 @5 F# K$ [; Cend
- O& \' b, I* Z. \+ a2 q& X* u6 a( h. x- I1 N" ~# U. ]
其中的procindex为整形,代表当前process的序号。
: ]' s$ r' r4 }/ q) \% b; {% Wstation和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-7-13 14:07 , Processed in 0.015517 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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