设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12556|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) q# w: V( _. x) W! b0 o
  m! i0 S7 U8 h* F2 a我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% Y3 f! t! i8 e( x6 ]: q3 _& c! `! g% m+ v
begin P_read arriving% e1 K' P# V/ \- D
    while 1=1 do begin
# b# G0 C% A5 X6 [0 Q) s- d' m; @        read A_tote from "data.txt" with delimiter "\n"
& K0 h9 x2 R! [3 g8 W  d        read A_time from "data.txt" with delimiter "\n"
) E3 k5 U3 Y- F        read A_leave from "data.txt" with delimiter "\n"5 E3 U: v5 w3 i- m! a+ ]4 J
        read A_picks from "data.txt" with delimiter "\n": t# n0 m/ R1 @. Y! i( m
        set load type to A_tote
2 k7 L9 F7 j# T( k$ H# T        if A_tote="tote 1" then set A_induct to 1  v+ Z/ _1 m$ ?6 p
        else if A_tote="tote 2" then set A_induct to 2
5 z. _: p# d- t- y7 E; o            else set A_induct to 3   
: c1 O7 S( H" O, e$ U        set A_i to 0
- q' `& j9 K9 X0 \$ j- j: \        clone 1 load to P_induction% e. w% v2 a- F: }8 R: a
        wait for A_time sec
1 b6 E7 x/ x6 B: K2 x4 Z* }( i    end% E! O! u4 `' \3 u7 g3 b. i
end
% E6 v6 V8 [3 ~' Q
+ C' `0 y4 Q4 L2 ebegin P_induction arriving, _, e6 D+ s  S0 r/ c
    if A_induct=1 then clone 1 load to P_pick19 i% ]9 k- w5 Y' @7 L6 E
    else if A_induct=2 then clone 1 load to P_pick2; G  I+ }/ B4 f; E% N( O3 ]( f
        else clone 1 load to P_pick30 W2 n0 U  m) @, b
end$ c7 F8 J* p3 D+ _+ d  B% o
7 o' u! K: D, G8 B
begin P_pick1 arriving; T1 c2 P1 x; [5 m
    set A_i to 1
1 d0 k1 j: M1 N# ~! y5 f: c9 p    move into Q_induct1
! Q: M8 X# J+ p' Z) T2 [! v" K( J; F    move into pickaisle.induct1$ ~3 x8 i7 O" A5 p( a1 Q2 H. j9 \
    while A_i<=30 do begin% r+ L' c- }6 \9 j/ i2 Q
        travel to pickaisle.con(A_i)
- C$ [. i* S5 k: \0 l) P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- [$ Q& `2 f* `! \2 I        else wait for 10 sec/ t# M$ t& F# W5 |  w& y
        if A_i=A_leave then send to die
9 w  \+ G* w+ D+ I) \4 w# m7 I* \        else inc A_i by 1
+ A5 l9 Y6 f- a) o* m    end
& m' B: L$ \: {1 v) tend
* m6 x9 J$ a, f5 X& x* n$ \/ g3 F' a- v3 ]* S" }6 i0 c3 c; Z4 B
begin P_pick2 arriving: ^" m6 M. W  k7 H1 y1 {
    set A_i to 11
! K8 j- z  K# Z0 s& x1 Y8 B! M    move into Q_induct2
7 Y( c. U  |" ]- ]: R) y4 Q9 A. i4 Q, o    move into pickaisle.induct2; P2 q1 X9 {; ^
    while A_i<=30 do begin, r$ }$ ]$ z; C. f2 W5 L7 B0 w# L
        travel to pickaisle.con(A_i)
0 u* B$ |% E! Y" P. ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  L9 [# @- _% [) b* u% Q( v3 O        else wait for 10 sec
& r9 b' e3 a" P1 I8 x: N) k, o        if A_i=A_leave then send to die
, D  a- v0 L0 n* d# {6 L9 \        else inc A_i by 17 o4 V) s8 [0 t5 k. o
    end
4 F; E0 _  s: J2 p; \& fend  `! ~' R8 f) D2 W

& S0 [% W! ?! x' \  nbegin P_pick3 arriving# x( [! L3 t+ H+ n
    set A_i to 21
8 ]' Z. G8 U1 c2 F: c1 o    move into Q_induct3
& N" \% y: m9 t/ B$ c, u! D    move into pickaisle.induct3
% @( n( g, L7 t6 ^( \; \    while A_i<=30 do begin' K! w& V( Z2 [/ q1 d- `
        travel to pickaisle.con(A_i)' R! T* e& r- k1 `5 @, ?$ `9 d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) [0 E9 U' G( J, B1 Q        else wait for 10 sec
6 s5 t6 }! W  c2 M        if A_i=A_leave then send to die2 T: q4 d# Y0 c- G, H; G9 t
        else inc A_i by 1
  f( J7 Y) T& I& [# V    end/ q! C  [8 C- h: B5 ~
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是个什么东东?
' U. [; q' o8 S( o* J# M9 `: ?move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 X, O3 x+ P$ }( D3 Q# G+ h" S/ T" s7 C: a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ h8 |  C$ a9 c7 R7 M; @
# I( Y' q8 W$ \5 T! i; u  T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. i+ u* a) W2 E0 U* i; r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 H" ~9 @0 _' U1 z; I% z& O. _2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  Q4 q, X) M+ j8 |4 m/ b3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! l' H  }; r" H* c( _begin P_induction arriving3 X3 k9 O7 A$ p! J: t. d
    clone 1 load to P_pick(A_induct)
5 n1 b, Q, u+ w  |% B2 uend最大的系
) ]3 r. m* d: g5 n, z4 K- E, Z7 T. o
begin P_pick arriving- C. z5 L- z" A
    set A_i to procindex * 10 + 1
. Q; e; F* D: U, m! F; L    move into Q_induct(procindex)
% X, W' o% t# Q0 [0 o, w& P    move into pickaisle.induct(procindex)& B! b( ^- k& L
    /*check the type of pickaisle.induct(i), for your last problem.*/
7 w' G4 T4 r+ Q5 c
, H  U" ~6 Z0 P4 e9 M5 y    while A_i<=30 do begin* e8 n, m' a! P: n- |
        travel to pickaisle.con(A_i)" g0 u4 B" k+ e8 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) k! e: E, f1 {        else wait for 10 sec1 i7 d$ a& H5 n& C0 J3 F
        if A_i=A_leave then send to die- V6 A: a3 s* C- B! T8 x+ @  P
        else inc A_i by 1
. F' H1 ?$ u" c6 p( \) B8 x    end
5 V( m; M* x( o; R- zend3 j- P( u9 m5 D. [, `

, W+ d9 p3 i6 v; a& F1 p其中的procindex为整形,代表当前process的序号。
6 r+ u, c. Y) O6 estation和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-31 22:42 , Processed in 0.017608 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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