设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14771|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  E) o1 C5 |% W6 c% |6 ]* ]
$ ]( B, s" f+ @" R3 K) o! y我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 f- j' y& {6 R) }2 G

, V0 l3 F+ Q* X  M2 e7 wbegin P_read arriving" q# ~6 C1 Q# Y# a, c
    while 1=1 do begin
/ K, ^& A8 r" O) `        read A_tote from "data.txt" with delimiter "\n"
9 I8 a7 {& L3 B- P6 a        read A_time from "data.txt" with delimiter "\n"2 h( _5 o( V& k& h% a3 c% s7 ^2 T5 d
        read A_leave from "data.txt" with delimiter "\n"$ o# M+ F) {. ~2 ?# x
        read A_picks from "data.txt" with delimiter "\n"
' M2 `: r0 H8 ?1 Y# z        set load type to A_tote
1 y0 N, I! l1 M        if A_tote="tote 1" then set A_induct to 17 q3 e6 b# y0 N" {3 w
        else if A_tote="tote 2" then set A_induct to 2" ]" j- X9 u- q, X% S+ ?
            else set A_induct to 3   
8 K5 l% s% x7 Y/ b% B        set A_i to 0
5 L6 ]7 B! O6 [6 j3 w+ ?        clone 1 load to P_induction
8 {6 t3 D' }+ h/ d        wait for A_time sec' J4 y5 U; k- l2 O' c  T) F' q
    end* d/ Q2 T: e3 m  u/ m5 O
end
, U6 p" d9 ^% L5 j  C3 _
  @) `; E2 H+ d( ybegin P_induction arriving
" ]$ \: {+ z% y9 j6 v# z( b    if A_induct=1 then clone 1 load to P_pick18 D6 u$ P: W% `6 ?( b
    else if A_induct=2 then clone 1 load to P_pick2
1 i& _% v! O$ a' @  x3 d8 d        else clone 1 load to P_pick36 v. r! k1 ^& c
end; i" X9 [, M7 F

9 ^$ i6 k  X$ p1 L' ?4 ]; U- Vbegin P_pick1 arriving
* r. l: l6 }6 O" h4 I2 Q$ p$ u# r    set A_i to 1
) W& W- _" T, K, \# `0 L4 p; Z    move into Q_induct10 B4 _! }& B# r
    move into pickaisle.induct1# l. V; z6 [+ J; G, }9 l* q1 c4 Z
    while A_i<=30 do begin" t' O# {6 L6 \0 W9 l
        travel to pickaisle.con(A_i)4 k* O: Q- [5 z$ y& M+ [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) O. h1 L! q# `2 X0 ~& ]. S        else wait for 10 sec5 r$ f# D; E$ E& \: x
        if A_i=A_leave then send to die" Q' U7 S/ |  T6 o9 ?3 y
        else inc A_i by 1
4 ^+ t) j! q; N" n, D4 o2 u( a    end
4 O" [+ z' @2 O) wend8 g6 \" j7 r; T* t8 U, {# B

0 D- d7 }: i% s; wbegin P_pick2 arriving0 P$ a- }- _7 o; D+ K
    set A_i to 11
+ R* j: Y) U0 z, J" B    move into Q_induct2
6 w3 K; Q2 S& w    move into pickaisle.induct2
+ w% p8 Y* J+ `* A. }    while A_i<=30 do begin' i7 M5 ~" H3 n, i
        travel to pickaisle.con(A_i)
) M7 x/ @3 }1 V1 p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) H+ K5 d& A1 c4 ?0 I( g2 N6 R, p        else wait for 10 sec
% [* G$ ?1 Z3 P" q" G' R2 D3 ?        if A_i=A_leave then send to die# x6 L7 k( P# E9 j# b  w& n
        else inc A_i by 1
6 L, N' e3 W2 ]+ L. L9 Y    end0 ?/ n) ~4 S6 T7 \" z# P
end9 L8 r6 X1 F3 ?

! t' l4 U# }1 I$ \, n1 q/ gbegin P_pick3 arriving
" Q. X/ O/ `' T- D    set A_i to 21- u$ }2 W! v5 R
    move into Q_induct33 K# {( n5 K9 P, O
    move into pickaisle.induct38 G" f4 m: U# W: O0 U
    while A_i<=30 do begin( M* w4 b  [) C. e8 i, a" J- x
        travel to pickaisle.con(A_i)( A: v- V: e+ T5 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 L# Z, q! y, w- ]4 e        else wait for 10 sec
# V  g0 c' R+ {* L: w# g! {        if A_i=A_leave then send to die  t  T; C- F. B; F
        else inc A_i by 1: v+ @5 Z- ~6 ~
    end0 i7 J/ U: A9 ]; j7 I9 }5 ~
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是个什么东东?+ p9 A7 a! Y0 b( w2 |! s
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?% Z  |/ Z, O& w8 X: p

' j& b& M0 }7 Z6 M5 q! jAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 ~. d1 b0 ^7 F+ y+ b5 z0 t# P0 T* R+ f& h8 U/ ~
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
; k# Z) S! W/ o0 B8 Y! U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( J/ ]& T/ @' s  h& e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 ~+ l9 y6 h/ p! }7 V# z3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; ~0 n& ~3 x8 q, n6 R2 b6 w
begin P_induction arriving
0 c& p( @( G. O$ T" J- b6 i    clone 1 load to P_pick(A_induct)
" s2 c# ^+ W% n0 Y' a$ ^$ n; uend最大的系
5 j. [/ r2 N  e' J4 ~" I% d% l1 g
begin P_pick arriving1 y  [" c0 V2 Y8 D5 v7 O, K
    set A_i to procindex * 10 + 1* K  S4 a. L5 u: R
    move into Q_induct(procindex)0 d" j4 m2 ~: i: |6 {$ c0 E
    move into pickaisle.induct(procindex)' e/ h9 H0 p) R- ~+ C
    /*check the type of pickaisle.induct(i), for your last problem.*/; b! S. m. D8 y2 b! Y2 e
" I/ F0 I; @+ j0 z- E4 W
    while A_i<=30 do begin
  G) [1 \5 t+ a/ U        travel to pickaisle.con(A_i)7 J1 f+ J* b' m5 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 \6 @* `9 F8 ]7 ~8 Q& D- c. I
        else wait for 10 sec
3 U. `5 T& f' g6 d        if A_i=A_leave then send to die$ S2 _" @' k' w, k# e3 Y$ F
        else inc A_i by 1
6 \) E+ _& _8 u    end
! l6 e% y- L, I9 c0 ~4 m1 s8 C  hend
6 Z5 k+ \  t0 w. z0 H
" \- a: u" i1 N! p$ E; `其中的procindex为整形,代表当前process的序号。
( x7 d) i5 `9 k9 _4 n. p1 astation和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-26 01:26 , Processed in 2.271497 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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