设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12221|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# u( Z2 A. U$ e- I! q

# V0 @! \  }, u$ f0 N2 |6 M; ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。: `6 w: }. z4 p+ Y  A' o

" W% t* T7 P0 F0 _5 Z; fbegin P_read arriving; \: ~1 h% c% S- K% D
    while 1=1 do begin
( E* q& b, T4 @/ h/ _, D4 ^        read A_tote from "data.txt" with delimiter "\n"
& _6 V/ B" s2 \        read A_time from "data.txt" with delimiter "\n"9 t% l" h3 L6 j" j3 b
        read A_leave from "data.txt" with delimiter "\n"
4 I1 o* M" Y& S4 |3 W4 @% B        read A_picks from "data.txt" with delimiter "\n"3 g$ D7 i, X: x( i2 X7 E; d
        set load type to A_tote- [* s% {  C* J# U& d' @+ ^' {; v
        if A_tote="tote 1" then set A_induct to 1
- N$ p* i3 F1 l8 Y- ?" p; s1 B9 \        else if A_tote="tote 2" then set A_induct to 2
" ^+ t" c' C0 Q  U7 `- j$ L            else set A_induct to 3    / L! w6 C" K- E
        set A_i to 0
$ @; Y, r6 w( B8 P" }1 c        clone 1 load to P_induction) C) h1 j- G, l$ |: Z2 d' S8 w
        wait for A_time sec
1 |3 b, R! H! L+ m2 C2 D    end
; }: S$ j, B( G- o( E3 t; f* s  R* aend$ ?; Z+ D2 D  ?
: P$ o5 G3 m' g4 E
begin P_induction arriving$ h) }$ W( p, D  O* u
    if A_induct=1 then clone 1 load to P_pick1
9 q5 `0 a  y, W- B9 w    else if A_induct=2 then clone 1 load to P_pick2
! P- g5 O) d" r# m, W6 G        else clone 1 load to P_pick3
* \7 g0 _$ n* Z, h0 hend, j; E7 H; M0 `- P

4 i( U4 F- }( K+ d6 Kbegin P_pick1 arriving6 C% x; q& N$ F
    set A_i to 1
7 y2 {0 V& @: N+ g    move into Q_induct1+ o  G7 j) ^# K7 N& Z
    move into pickaisle.induct17 F  w9 a* ~. O  A0 b
    while A_i<=30 do begin
" d! s. r# T! j2 e        travel to pickaisle.con(A_i)
1 ]4 _% `0 ?; ~# q) D9 A        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ F  u- P4 R. T, f* K4 \
        else wait for 10 sec
7 N3 [7 j6 u5 i% v  z  V) t        if A_i=A_leave then send to die
! V1 `# C) P* e8 E( ^2 b" _        else inc A_i by 1: s! f; M1 ]4 [9 n
    end
( }: b% o1 o6 B4 a! |end9 i* P0 m9 }! O- `: n
6 S- d4 Y, v- E. |/ Z5 p" W
begin P_pick2 arriving
& C& C' t/ f3 p8 W    set A_i to 11
& Q& P+ m; {$ c) i0 G% z( W* y    move into Q_induct2
7 [; n  t3 [5 L0 d& L; f    move into pickaisle.induct2+ a6 O* }3 N' M, L
    while A_i<=30 do begin
& y7 ?, U+ O  Y( `" o- G( ~        travel to pickaisle.con(A_i)+ O0 \: J. {( }$ {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 I( f' a: j9 Q# E/ @4 r        else wait for 10 sec
7 N, x& d: q1 R( t/ b5 w        if A_i=A_leave then send to die3 Q% W9 N: ^- D! _- J/ D
        else inc A_i by 1* Z% q. m9 m$ u" T' I  K
    end- U0 @2 M# ^0 w0 C
end
* o2 z- H0 N7 p4 k; U
$ j' m( G  W3 j2 D7 pbegin P_pick3 arriving3 e( J' j0 ^# s( e  Y# X
    set A_i to 21' M! k% i  k: F8 q1 J% D
    move into Q_induct3
% d% W( w0 R9 @    move into pickaisle.induct3) E) Y& r$ j  M5 l, s/ A: [: H6 \
    while A_i<=30 do begin
1 v2 ~: J, e0 I$ \, K+ Q9 d: p        travel to pickaisle.con(A_i)% K2 h- U1 v0 h' _: [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ y" N. m2 e" B. D8 K; s        else wait for 10 sec
3 C1 A5 y' V- I! `3 m9 i) ~. u        if A_i=A_leave then send to die
+ E0 l1 m8 [, `$ R9 a  T6 L, ]5 N        else inc A_i by 1
( u& w6 l, ~/ P    end  X; _7 t& w( K0 [7 Z+ 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是个什么东东?" D- K) H* |  ]: Z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 f  |, o  ?" j! l( |. c
! M+ V% I7 b( C7 o; i, a. y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ s& Q2 l* P! E/ q
1 k! F" U* I) D; x: j1 L7 l) v; B# a另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( G  T- s  s: h2 z: C5 {" f
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
$ f7 d) D+ T7 S7 ~% e1 a* Z& u1 v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 a' @1 E9 C6 E' q9 Z
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) I/ u; Y0 z- o5 e; ^6 b
begin P_induction arriving6 R& _: P! _1 q4 ]4 ?7 `
    clone 1 load to P_pick(A_induct)% G  Y) A2 U! V: K* |6 z
end最大的系
3 ?  l: e/ ^9 s. N' H
& c+ `/ W+ Z4 [" g4 ybegin P_pick arriving
. r) K9 h" N) z6 K6 _) }* O    set A_i to procindex * 10 + 1
5 s; l8 n. O1 o    move into Q_induct(procindex)
. V! {( E5 b" {& W* Q    move into pickaisle.induct(procindex)
3 U  d, a3 ]* i1 h+ M; @) ~3 k    /*check the type of pickaisle.induct(i), for your last problem.*/; w& Y5 \0 @1 C7 t- H' O0 v0 ~, q
( E' J" a' |# Z4 B3 o
    while A_i<=30 do begin
, |" b* m( W- a        travel to pickaisle.con(A_i)$ F! z5 H+ K' y# M( |9 j+ J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% g9 F' h& m6 n. C( R$ ?3 a
        else wait for 10 sec
+ M1 s7 x# w8 {0 U' z        if A_i=A_leave then send to die, s( I$ U+ g; \) T( z! i3 {
        else inc A_i by 1
6 N, M, Q, N, W9 T2 O    end
9 V" \  _7 a- M7 Q; v# \end
, q6 ^9 R4 b7 w# ?- g& r
' ~1 ~: v8 t4 L6 Z% P& m8 B其中的procindex为整形,代表当前process的序号。
! r' b/ h4 E" O: O6 w! P( ystation和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-1-5 09:54 , Processed in 0.020785 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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