设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14384|回复: 2

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

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

0 R5 Z& N. i1 Q我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 q3 ?, p, c' N! _$ l
  b' R: Z9 z- Tbegin P_read arriving$ z) o2 s8 w- L& k& L
    while 1=1 do begin
" B+ j& l1 U' @' {0 G        read A_tote from "data.txt" with delimiter "\n"
! u- l1 `, z! P$ K( J  e; F: T        read A_time from "data.txt" with delimiter "\n"
# ]) U5 h  Z2 ~# y2 M3 t1 O        read A_leave from "data.txt" with delimiter "\n"
, L2 E2 L# E/ L+ Y1 J* F2 c8 g        read A_picks from "data.txt" with delimiter "\n"$ s' W! A( `9 E
        set load type to A_tote
* Q7 \- P' O$ b' _0 ^' n        if A_tote="tote 1" then set A_induct to 1
  [; x4 V+ F) j& h- G6 L0 A: O% Q        else if A_tote="tote 2" then set A_induct to 2
$ w" Y* E( t7 V: R* y2 ]7 T3 c; X            else set A_induct to 3    2 [# z$ y: L$ Z/ y! C( |8 W
        set A_i to 0
6 F2 e/ d$ E! R/ Y$ b  z4 N        clone 1 load to P_induction2 |6 {$ Z5 V; S
        wait for A_time sec2 K% C: t* O+ P/ b- a/ e: `( y7 @
    end6 C5 ^1 p% c% k( d# i/ M, x
end, J7 [6 e1 ?9 L3 N0 V" \# e/ F
" n# Z  b' v: _/ T
begin P_induction arriving
9 U$ l! j8 `' [& u! O    if A_induct=1 then clone 1 load to P_pick1
& m8 B" W% @8 W* ~7 }& S0 E$ S- H    else if A_induct=2 then clone 1 load to P_pick2
* ^* X& i2 n8 ~( ]8 ^2 d* S        else clone 1 load to P_pick3# |" V( u/ G% O4 h' T3 _' S
end  h3 ^2 I3 B2 O5 X2 o. [

: G! _; F: h2 x( _- p0 a( Nbegin P_pick1 arriving& t" W- A8 u0 K7 G& C9 ^, r+ p
    set A_i to 1
' ~% g5 v" x6 O0 [    move into Q_induct1
! z1 D' A$ C( \    move into pickaisle.induct10 R! S% W) Y8 B1 B: j. C3 ^
    while A_i<=30 do begin  e5 Y" l: [7 `7 ~* ?- [5 w/ I# F
        travel to pickaisle.con(A_i)
4 I: r3 h- i1 i& y0 `) {5 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 \( R+ g: y# ~8 a9 q/ f        else wait for 10 sec
5 Q0 X( F3 W2 J$ \: W$ L3 E        if A_i=A_leave then send to die
7 c+ [4 o) y- H, r; x* e        else inc A_i by 1, C! E2 _# }. Q4 j
    end( t# {$ S# }0 `! b. S8 H
end
; f/ B3 x% Q* @6 f6 k1 w( z, Y6 a
3 ^% P! R5 Z, N* N: f5 Kbegin P_pick2 arriving$ w7 }0 b0 d, [! o, E2 q* v6 O
    set A_i to 11  R. |/ e* C# n3 {$ N" ?( E
    move into Q_induct2
* O9 @, b4 u# e$ L    move into pickaisle.induct2
- t6 Z& w' u" t: a. g    while A_i<=30 do begin
1 `% X5 U. e; R. w+ F        travel to pickaisle.con(A_i)
+ e' F  s. @# o) d8 {' h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( _' n7 S, V% D- D5 P; P4 J- C+ }
        else wait for 10 sec
# f. y/ [$ t8 D+ A# c        if A_i=A_leave then send to die! r  y; L3 h; X6 [* L3 u
        else inc A_i by 16 ?; ]% {" P! y- F" V
    end
* k. t6 d: d7 s% q, c' `( `end$ [; u- k) b& C5 N

: q4 \4 y( F8 V. Y+ Bbegin P_pick3 arriving
/ @! z( X  f# u' B    set A_i to 21
3 [. n2 H. C+ O, E* x    move into Q_induct3
' ]. L1 [. F5 d- G  }4 L- b    move into pickaisle.induct3+ t, ]: U# h- Z. e7 Y, \+ t0 K
    while A_i<=30 do begin* F7 n* S0 w; Y& [0 t3 Q& F: Q
        travel to pickaisle.con(A_i)7 U; U% f) H9 s& c5 Y. U5 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; \% T7 w% |0 U0 H- A# D
        else wait for 10 sec
1 R0 z( Z+ G* L) G9 R        if A_i=A_leave then send to die- a8 ~: M+ U5 g) C
        else inc A_i by 1" K7 G0 m/ h+ f% Z
    end( P2 O  H! d1 {* i$ x
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是个什么东东?
$ l- N$ C6 q% `" ^0 D. x0 Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( M: r9 X: u5 |2 Q8 n% C" `7 \

! b9 K7 d3 ~! y  TAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 \' g% _0 C. T. Y2 y" ]% H

' A. C2 O  H6 E3 ^另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  K- L) R. ]0 ?" ~! U7 U; M0 L1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  S8 g1 w5 h( m6 r( P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 X% T! I' S  m- X! }2 v3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& K7 A5 E; u! s% G
begin P_induction arriving
) n( e" {6 B  s2 g    clone 1 load to P_pick(A_induct)1 b+ Z5 L) X) U+ Q% U$ k- g7 D
end最大的系
, e5 t6 R3 J7 M1 ~/ K0 H7 p, W" S2 l6 c: P( e6 d4 C
begin P_pick arriving$ D: z2 L! j# y$ z1 M
    set A_i to procindex * 10 + 1
8 a# p: S2 H7 d6 U) R1 ~9 y4 h6 U    move into Q_induct(procindex)
5 O( h( p. a) P- P8 p    move into pickaisle.induct(procindex)
! p6 C; k" b* l    /*check the type of pickaisle.induct(i), for your last problem.*/  K7 d9 ?) Z. A9 Y- \
" i) d# Z* D: z! C8 S
    while A_i<=30 do begin& g; L" B% P7 Z# w/ v) V
        travel to pickaisle.con(A_i)8 C# O7 V% @( Y. m: T2 X& i! p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* o: d$ D7 K- D" }) ~* }* @
        else wait for 10 sec
8 ?+ f1 a) i+ F) C8 o2 c        if A_i=A_leave then send to die
$ D3 D( A# j0 }4 c8 N! i5 j        else inc A_i by 1( ^: F( `; ?* P( p9 O  s
    end
( D2 X( E: b7 }end; k8 }1 y; b) K6 K1 ?0 v  m6 t# M

$ W+ Z- w8 f6 D: y$ P2 F) B! x4 s: N其中的procindex为整形,代表当前process的序号。, ]2 v. r9 v/ q, C7 g
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-7-9 11:08 , Processed in 1.971625 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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