设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11897|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 X( I- Q7 A. Z6 `) c  i
' Y+ g; i- J: H$ J我的问题是,在每个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中的数值,不知道会不会有什么不妥。: |7 {0 ^! m9 n2 {% U: I
+ I' f9 @3 L) B1 r+ M' f3 C
begin P_read arriving
# C8 X; f5 E( t, y) z5 d4 A    while 1=1 do begin* {- A! v- ], z$ y& ?' A5 ~
        read A_tote from "data.txt" with delimiter "\n"6 H* {) t/ m1 {
        read A_time from "data.txt" with delimiter "\n"" I% b! f& Z/ r; A% H
        read A_leave from "data.txt" with delimiter "\n"
& n$ M3 w8 ?" J  n" \9 Q        read A_picks from "data.txt" with delimiter "\n"* d& z/ r8 M" `2 B0 v
        set load type to A_tote
5 X+ j) S# a; M, `1 B        if A_tote="tote 1" then set A_induct to 1
" d, \# p/ t( A7 e( q+ K% K        else if A_tote="tote 2" then set A_induct to 2! u0 t: H/ v  q. X7 t% F$ O
            else set A_induct to 3    " c7 o2 t2 u* Q7 t% G& b5 x
        set A_i to 0  t2 D, L$ t6 G8 z7 O! ^2 O
        clone 1 load to P_induction% k1 F; B6 d' A% }& x' M- ?9 K
        wait for A_time sec
" l  ]8 a! y: c$ _0 M  l    end
- O# v4 x$ Z$ r5 pend
* T. n. B+ r, N1 K( Y- }) E/ F
$ ^2 ?- Y0 S7 Tbegin P_induction arriving
6 ]2 y" O8 ~  }) k7 l4 i8 }7 x$ P    if A_induct=1 then clone 1 load to P_pick1! F! q( H/ R* p* R. {9 }3 Z
    else if A_induct=2 then clone 1 load to P_pick2- L; M: I) [$ `  y, F" r, k
        else clone 1 load to P_pick33 T1 i0 E' M, r' Q- E
end
; N1 ~/ X# P% A6 B! \/ o* y6 k' k
2 w7 q) z* |  o- @! sbegin P_pick1 arriving
+ `% `& r. o2 C2 T2 Y6 |) o+ J    set A_i to 1
. }. F8 j" X; Z7 k, i1 {    move into Q_induct1
$ m; M. L. I" L* _6 ^  j3 u- {* Q    move into pickaisle.induct1" g* ~4 X# j4 H7 r, Y/ }
    while A_i<=30 do begin
: T' c5 R" K1 Q5 V2 d) X        travel to pickaisle.con(A_i)
9 u$ W, W8 C7 A8 W+ x* j0 N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% B7 M) T- D2 j+ z* m        else wait for 10 sec
, r) z& [6 k. r% R2 i        if A_i=A_leave then send to die
4 P# b3 r5 G) v% b        else inc A_i by 1
: n1 p& f4 q+ |    end
1 |  L: L# T. n/ ^) uend
, e4 V! R' P0 h5 d, c+ f3 ~! O1 S, s, d9 N- ?( c5 i% m' h" n
begin P_pick2 arriving
: @" c* r. V: c% g    set A_i to 11
( c: s2 W$ N' E    move into Q_induct2* f6 z7 j% j: y- X4 ]
    move into pickaisle.induct2
: E9 Q# e; I( {/ {' C    while A_i<=30 do begin
( X: d8 x8 H4 r. u        travel to pickaisle.con(A_i)! R! E0 |! K6 x; q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* L0 L) j! b+ r) O0 L6 S5 a        else wait for 10 sec
0 `, r5 A( Y: q0 P9 H$ c" v        if A_i=A_leave then send to die3 j5 [- g  j- C8 A
        else inc A_i by 1( M$ P% C3 q8 \+ j3 p/ Z  E" v
    end; c1 |! ^1 F4 g1 Q  T% n
end: {8 k7 Q# C' S. a" r2 A, }1 n
/ A) d! @6 {- l4 Y/ X+ t
begin P_pick3 arriving7 X' @: H3 p# C8 t% Z, R' a" P& G
    set A_i to 21% F( a* m" G9 m8 B  u4 @3 ]0 ^
    move into Q_induct3& t  \8 H1 w, P+ `0 c/ q6 @' G5 @
    move into pickaisle.induct3: T+ M- k2 p: b: I1 s) O9 o  J
    while A_i<=30 do begin( D! `8 ^9 O$ t' n
        travel to pickaisle.con(A_i)5 b6 W) N7 C6 f) q2 k2 ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ^! K2 ^- _: {/ r        else wait for 10 sec7 s& ~# h8 [( l6 V2 Q: L/ |2 a
        if A_i=A_leave then send to die; S+ |# \  X1 K
        else inc A_i by 1. d7 @& [3 u+ L- m" l7 p
    end- M) a1 b" J; t+ h" }
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是个什么东东?) ]: n: [2 M* W' [" v* ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) r$ d. I; {: A- H% {

. g: G& j+ `) w* FAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( y( D6 s6 _2 D

8 g- @& H; I2 J8 M0 e  [( T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 E8 R9 k  g4 X% P$ J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 R$ i! y3 y1 d7 h  ^
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' r; Q) w- {; N/ S+ E5 g; u
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( W% L7 U( X/ I
begin P_induction arriving6 K- f+ @) ?' s% L4 M8 _7 B
    clone 1 load to P_pick(A_induct)" P( f% A  X+ `9 X. P; S
end最大的系
( g" J* |0 t) L  M- D. t6 Q
, R5 f4 d) z6 Ybegin P_pick arriving8 U0 z1 R6 D% Y) w9 n! ?0 }
    set A_i to procindex * 10 + 19 F& @0 V' O& C5 c1 A
    move into Q_induct(procindex)
/ s- I& h/ S. g' r% M. L    move into pickaisle.induct(procindex)2 k7 q% b: W0 q
    /*check the type of pickaisle.induct(i), for your last problem.*/+ M! e3 t9 a6 D$ @( ~! F: C8 d+ D
( S7 |' Q: b# d1 U! [* t
    while A_i<=30 do begin
! z! k/ [& o4 {: O' B5 G        travel to pickaisle.con(A_i)+ j/ C; S5 p2 P! u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 ^# ]6 J, @" E' U. P# ?% X        else wait for 10 sec" V. T# q; {8 ]) ]* Y1 w
        if A_i=A_leave then send to die
; B/ i) C+ f" \. A$ e" h- d  {# u        else inc A_i by 1. k# E  ]& H4 D4 F% t9 R
    end4 D2 b3 W6 n& t7 N4 N
end1 d# `" X. p+ _! i6 B

' P( h3 ~/ J9 G1 L: D其中的procindex为整形,代表当前process的序号。
4 f3 y% }- m* q8 Z6 O* w- J) W. B; ustation和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, 2025-12-13 16:16 , Processed in 0.023727 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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