设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12571|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 A' H* Q+ S: N2 Z1 r  ]. ]! ?, Y8 |4 D9 d
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! |- n$ n* E2 y/ p% ?+ S) {0 n
+ D( x2 l' l4 T% P# L
begin P_read arriving1 i/ X  q7 a+ A) x  c2 B
    while 1=1 do begin
) x7 O' L  s: Q( A        read A_tote from "data.txt" with delimiter "\n") l7 y  Q, Z$ b# u, E5 n% P
        read A_time from "data.txt" with delimiter "\n"/ x: f& R* {' G0 L$ F1 L6 R' ~
        read A_leave from "data.txt" with delimiter "\n"& U8 ~4 @7 h2 o2 ^3 \" l  |5 U+ {
        read A_picks from "data.txt" with delimiter "\n"* n4 Y4 H- W# R( h+ }5 X, @9 M) I
        set load type to A_tote" {3 k/ o) i' b4 w5 m
        if A_tote="tote 1" then set A_induct to 1
! V) m) U0 v* [        else if A_tote="tote 2" then set A_induct to 2
# C( Y5 z- j2 h+ D            else set A_induct to 3   
+ d# @, N$ B2 T9 m3 g4 U+ v        set A_i to 0
% C6 W! z! V! P        clone 1 load to P_induction
& A0 w* `  B8 i: b        wait for A_time sec  B' q; X4 ]" i$ H- f# y4 x
    end& P% k" Q! {* l, F& d
end6 I. j0 v7 A6 \0 B% X
+ t2 h1 B! K) T6 @& q* T
begin P_induction arriving
) v! |( B0 B9 Z2 N    if A_induct=1 then clone 1 load to P_pick1& E. G$ H4 C$ w3 x6 f) W
    else if A_induct=2 then clone 1 load to P_pick2
3 M" s% f0 Q0 l' }  V        else clone 1 load to P_pick3
& S) ]: ^$ H. b. X% Uend
7 ~1 V$ ?4 M% O+ e+ i7 G' V* S" K: x# ~
begin P_pick1 arriving
( G: \$ d7 _& o" _0 e) p    set A_i to 1
  _* i) R* R; G) ]6 J) f, t3 N    move into Q_induct1
1 t8 `4 r5 y6 Q4 g$ G, {    move into pickaisle.induct1- n* S) j) h7 X0 H2 ~0 `) Z
    while A_i<=30 do begin: Q* p) R, L- @5 N0 G
        travel to pickaisle.con(A_i)! F! v/ h3 M( L/ N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ B, L* C5 Q; O% v
        else wait for 10 sec  u, s! h! S* n
        if A_i=A_leave then send to die
" Y4 Z. W4 u/ z6 B; V4 ]* U- F        else inc A_i by 1# v9 s' u  s2 Z% \$ n) b
    end4 Y- a5 h/ B, l. {
end
  Q$ S- Y: v& H! M3 g2 O
7 }9 ~4 `8 x) O$ o% M( |9 H. a9 kbegin P_pick2 arriving
# R& H6 l$ k0 `* Z4 I+ p    set A_i to 117 P/ C* t' q" l/ W! ?+ P
    move into Q_induct2* t" J3 n) e  [/ ]. ]% u8 |
    move into pickaisle.induct2  A! p: l: }# P, I$ I8 a6 g$ {
    while A_i<=30 do begin
* w" m, K/ k, m1 P8 {* Y        travel to pickaisle.con(A_i)
) R4 h$ d' w$ D( T* Y0 u" s  T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 M9 ]$ i) S7 ^& t) T  f* S        else wait for 10 sec) D# a. Z* y. P% N. S
        if A_i=A_leave then send to die. P0 o6 V; ~* u
        else inc A_i by 1, V  \! p+ x: l: {% a5 T
    end
+ N; L* n) E; t& Y  Y9 z& iend
0 \* i! A" N$ T; D& R% m2 B: E( j6 w, c- n) M
begin P_pick3 arriving
6 {6 ]1 A* F; ~7 l    set A_i to 21
8 x1 }( H  a! g1 ~! k    move into Q_induct3
. E+ z( u5 }6 ?8 ^# Q  u5 y    move into pickaisle.induct38 |! X1 o' ^+ s3 h; r
    while A_i<=30 do begin3 @2 D! p( T7 Z0 F2 \
        travel to pickaisle.con(A_i)
, L; n. q, x/ H6 U" J: T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 ~! e$ S9 c, e. f1 H9 a. r$ |6 _
        else wait for 10 sec
  s6 v& K/ t0 A6 K0 {; w        if A_i=A_leave then send to die- o8 ~8 S: m3 @# W6 _5 m  n
        else inc A_i by 15 Q5 b& v6 A2 y6 ~3 r5 c
    end: G4 ]4 _  v) q
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是个什么东东?/ l4 ~3 r- \* l# l' S5 H# x
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 Y/ |" B. `3 a5 v

8 c, f) ?' X) K4 VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。2 C* l% y% H* U! D$ F

, J) C/ \# P# G% t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) X  l2 z. ?% `+ k! l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 X1 l$ u0 }6 p5 \
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% A% X  _, I& _: G2 |3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. S8 B" [4 w) c! G, o
begin P_induction arriving' T1 Q4 j4 @& y# U. |1 U- I( ^
    clone 1 load to P_pick(A_induct): [8 x! A: M. ~8 l7 v6 b
end最大的系8 M% B6 b1 z$ }" t5 A
2 e0 X9 e4 j+ u# W7 ?
begin P_pick arriving# n$ B# r, H/ Z1 q' R; p& s
    set A_i to procindex * 10 + 1
, T: ?- r3 g/ R9 _    move into Q_induct(procindex)3 R9 u& w8 I6 h( Y5 `; E" p
    move into pickaisle.induct(procindex)
# O2 D0 J  t( h/ Z: `* L    /*check the type of pickaisle.induct(i), for your last problem.*/7 ~0 L8 S+ a+ y) ~* E; ^. |* F
0 m/ A$ L% R; K9 p/ S; ]
    while A_i<=30 do begin  s+ c# O4 A- [8 N5 Y" ?$ w
        travel to pickaisle.con(A_i)
9 n% {& i# p2 w$ X+ w: I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  `# g- ^9 d7 x% ?7 ~0 f        else wait for 10 sec& P0 |5 j9 P1 F2 N. I
        if A_i=A_leave then send to die
: p# u( ^, C* E        else inc A_i by 1
+ ^/ x) d' _( i/ P& F; M    end
4 `) v5 U# O- \end
/ P) K% P2 ~2 ]. w- K5 o3 l, G! ^# r" t$ f" b
其中的procindex为整形,代表当前process的序号。' m; p: [! P6 H9 P/ l4 u3 o/ q
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-1 21:38 , Processed in 0.014375 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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