设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13894|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, Z8 V8 g# e4 [; u! c! w) b' V
& d1 b% B, e; D7 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中的数值,不知道会不会有什么不妥。
- ~! ]9 W5 f9 l( {& v$ B/ p  @- ~, E6 v. E; m
begin P_read arriving& F- c  ]' M1 D- n, e# _/ w8 o
    while 1=1 do begin
5 Z7 F3 j+ e  u  R        read A_tote from "data.txt" with delimiter "\n"
  O3 I' Y1 v# Z) y        read A_time from "data.txt" with delimiter "\n"
! l, w: `, o; z        read A_leave from "data.txt" with delimiter "\n"7 X  K5 Z  S/ I1 L7 q
        read A_picks from "data.txt" with delimiter "\n"
) J) n% t. T1 c        set load type to A_tote
1 G7 V, S+ E. @! E9 @        if A_tote="tote 1" then set A_induct to 1
9 m- j0 _& X6 A; b0 W- \* n        else if A_tote="tote 2" then set A_induct to 29 ^1 i* u* W0 s* ]
            else set A_induct to 3   
5 k& X/ g( k3 \& C7 M        set A_i to 01 U) B4 T; o9 c8 t6 g* w  p
        clone 1 load to P_induction
( Z. z$ U( [0 u/ l        wait for A_time sec3 X# Z: h( @! X3 p& C' c0 `& Z
    end
2 A* Y: I  t' w- @9 j' f2 B! \end
4 X! i  P2 u) g- k
9 d/ d6 g0 d! r) v6 ^8 v: |begin P_induction arriving
/ M1 ~% @& Q# K, }# w    if A_induct=1 then clone 1 load to P_pick1
! X/ R: P, L. i& S, w& b& r1 @    else if A_induct=2 then clone 1 load to P_pick2  t! @# `1 k- p$ V  f* ~
        else clone 1 load to P_pick39 j$ l# W# [  q9 P& Y/ B1 c: ]0 K% q, }
end+ X, K" l9 u" p; f1 S8 C( u* i- X

+ n% ?. k9 N9 N. nbegin P_pick1 arriving2 [6 t8 d# @. V1 P' g! B2 T7 |
    set A_i to 1
; C* y' M6 W' A    move into Q_induct1
4 n* `5 u  t1 f2 D8 Y* T* ^    move into pickaisle.induct1
3 Z) I6 h/ F' E4 E5 N) A6 d    while A_i<=30 do begin
  m4 X) a. j' O: }/ `, Q# J% ?        travel to pickaisle.con(A_i)
! f3 X1 F. `! h. o& E, G        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" R4 B: ?6 X, W" F* G" k
        else wait for 10 sec* a* Y# M9 D3 ^4 j& e4 p4 U
        if A_i=A_leave then send to die( v( c! n6 L# ?; Z% b0 U0 E6 ^, X
        else inc A_i by 1
5 j3 C$ \" ]; `9 |$ D  m    end. H9 I3 I+ m6 F5 k+ B9 \
end
2 ^! g9 ?7 u- H+ D( C4 A+ y' N, q3 r  l: r, r) M1 l% O/ v4 ~
begin P_pick2 arriving
# H' H& R' \0 m! k- M    set A_i to 11  E0 q) C5 s5 ^5 y, A; d6 P
    move into Q_induct2
, z: W: U/ i  z- n/ P    move into pickaisle.induct22 \, c9 o1 g" P0 L. }/ ~8 a$ W' E9 _
    while A_i<=30 do begin: ~2 {7 h8 s2 A
        travel to pickaisle.con(A_i)3 S) \* _9 L7 N: R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ S/ R; v; S- @2 |& {( x        else wait for 10 sec" @5 K( Z1 m! r% L
        if A_i=A_leave then send to die7 S  H7 J7 B* V
        else inc A_i by 1
6 i: s& D% n7 o5 |    end1 k* j+ s! k- {
end
/ M/ c$ W. G; Y3 k& L
  c! J4 ^6 }7 g' ~+ ]1 l3 bbegin P_pick3 arriving) t* n* X  l" a+ m$ q3 |' l
    set A_i to 21! s/ [9 U1 \  b# U$ F
    move into Q_induct30 v% L) R( S9 @2 |) j
    move into pickaisle.induct36 g( N. ]9 d1 y) F* Q
    while A_i<=30 do begin9 U7 ]+ h1 m) O" l: _3 D% n
        travel to pickaisle.con(A_i)+ a; `& M9 T  A, i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 v7 [( ?. k9 g6 D0 [
        else wait for 10 sec
+ u- G7 }5 {' ?" [        if A_i=A_leave then send to die
' B6 U- K9 ]0 r+ U, N$ t9 @2 s        else inc A_i by 1" M5 w! ]- M9 i% L2 @6 }: t- K
    end# D: ~( f' k; c, o
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是个什么东东?$ R4 h: `0 f: a' o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?8 Y$ D$ ?1 }4 |- x/ y) E
8 V- q5 \6 p$ {5 Z0 t
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
5 P& f( F) g* b) \& e9 {7 u3 S, k  e- l1 }7 P9 Y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! P1 Y" f6 p) R% t% c# Y4 D1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 Q# {3 v* {0 u$ r6 B
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" r& E& L1 K3 V5 j+ A/ D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ d5 R5 t  [& `3 `
begin P_induction arriving; P: t, m! A5 _, E$ c
    clone 1 load to P_pick(A_induct)6 x3 r& F2 n& E6 v2 U  h) o0 }2 n
end最大的系' `9 ^+ r' K' `: W0 ^3 q

2 l# F; s9 O' J  O9 Ybegin P_pick arriving
- E5 o0 q/ C" X/ F" ^; x* P  K    set A_i to procindex * 10 + 1
, k5 [! u8 d3 {8 ~6 d2 @0 ]    move into Q_induct(procindex)) _; S& \- j% @8 Q/ g
    move into pickaisle.induct(procindex), {* ]+ ?: P8 l7 ~. h% I( P
    /*check the type of pickaisle.induct(i), for your last problem.*/
, @  G2 L2 c. p5 j  k6 V" j
% Y; h& I! }0 h    while A_i<=30 do begin
7 J* G7 C& I  x+ S- i" K4 g        travel to pickaisle.con(A_i)( m4 W& Q/ z  P8 L5 w7 G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 m! v8 Y8 Z% C8 K/ T4 h: Q) E, o# q        else wait for 10 sec
5 R# l) @, V- Z3 y8 _        if A_i=A_leave then send to die- `0 X4 \3 Z4 m: e# R
        else inc A_i by 1. [0 X5 E+ W. w3 `- R
    end
# \% ~0 h0 k7 k( Q, cend
; @3 B; H, V- W8 h3 L' i1 x2 E
* x% p8 G5 M: n" [- P其中的procindex为整形,代表当前process的序号。% u4 f8 C+ q& `7 d% F2 z8 s
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-5-16 00:20 , Processed in 0.020703 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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