设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12826|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 T2 ^+ S; B0 A  u' A  N# e
% e) M2 X! `& z8 ?; ]+ x! l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' g: c3 O  }* g, X: p. T/ l, e
) j+ I6 {9 b. C" N: ~
begin P_read arriving0 W$ y5 o% O* q
    while 1=1 do begin
6 m0 ^* N) S9 Y        read A_tote from "data.txt" with delimiter "\n"% `. N' c. p  E( N- ?1 h6 b$ N
        read A_time from "data.txt" with delimiter "\n"
! l4 j! W* {+ k' F  |0 v7 T        read A_leave from "data.txt" with delimiter "\n"5 [' [) I5 A- J- p/ ]
        read A_picks from "data.txt" with delimiter "\n") x- b, n+ I3 s# z! f
        set load type to A_tote
, ]0 U. m+ d6 W% V7 _        if A_tote="tote 1" then set A_induct to 1
" q& ^4 f* f+ _! j  V# D+ T        else if A_tote="tote 2" then set A_induct to 2) d5 p, C* M# I
            else set A_induct to 3   
1 \) B; t" O9 v9 o5 t6 S( [        set A_i to 0, e. Z; r* E) b% v- n
        clone 1 load to P_induction
) S; a) l9 v) O5 N9 b) _3 b, u        wait for A_time sec
  H) u; l; ?& r2 x5 h    end
1 N; Q! G: ?, N& q( c) [end" ]& M9 v% [9 `+ `

  x/ h# i- Z: @8 l) qbegin P_induction arriving
5 T) x- a1 s( ^    if A_induct=1 then clone 1 load to P_pick1+ ?; J. W) p$ i' {
    else if A_induct=2 then clone 1 load to P_pick2  A7 I  g( s* X0 h! e
        else clone 1 load to P_pick3
, U) W2 B. N3 A6 y. M+ ^8 |end. @) e! D3 D$ M9 a6 r
! d* e- F2 P( C# P
begin P_pick1 arriving# T$ Y( d1 `! ~& K) U6 S8 s/ C* w
    set A_i to 1
$ g0 t* c; _* y" h5 r6 H    move into Q_induct1  r1 }% G& q* e' H1 \
    move into pickaisle.induct1
# W2 ], }5 v% A2 b0 ?    while A_i<=30 do begin* I3 @/ d7 L/ Z/ W9 D# }
        travel to pickaisle.con(A_i)! [0 M8 [5 v/ F$ D3 p: q, S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 z6 W/ o2 v$ [1 M' Y" Q
        else wait for 10 sec
- E/ E/ s9 _! u/ d  U  y. R' e        if A_i=A_leave then send to die7 h5 u9 e2 S7 g" P5 `2 F  a
        else inc A_i by 1$ ^. f- n2 p' e: w0 D" S2 e
    end/ k$ h  j& d9 I( S4 ?3 s4 y
end7 s9 \4 l3 S% U) }% n6 m' p
2 l  J9 C/ L6 C& C0 J: |
begin P_pick2 arriving( d; ~8 M+ H1 q7 l. Q5 t
    set A_i to 11% z3 K. H+ `; J8 S
    move into Q_induct2+ X' W& }: C! }' }0 X
    move into pickaisle.induct2
$ y" M" X$ P, w: A1 D4 t    while A_i<=30 do begin
# ?3 z0 Z  T, a, _9 n0 B& w: p, [        travel to pickaisle.con(A_i)
9 U0 n$ g' N9 b8 j7 p" F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' w. y  o6 @' m8 X, M* J7 s        else wait for 10 sec
# ]; D3 o3 p4 W1 x, s        if A_i=A_leave then send to die
) j0 f/ {6 H( W7 s        else inc A_i by 1
: j6 t1 h3 t6 \8 a" [$ b( o/ h+ c4 I    end/ _. E! E1 A5 K9 f+ \5 ^# i
end
# ?0 {' |5 r0 b
/ M. C. V) Y7 Z; _0 }begin P_pick3 arriving3 D5 `/ l, c: h  B0 d; h8 t
    set A_i to 21' Y7 R& h2 j/ `, N$ R# `
    move into Q_induct3( s9 ^. i3 p" ^- X) S0 [
    move into pickaisle.induct3  [" v4 X' a- U4 g# q
    while A_i<=30 do begin
; C; o' V, S6 C. z6 Y        travel to pickaisle.con(A_i)6 ^4 _1 K+ E7 G( A. p. [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; T; z" A$ e' `! O2 W
        else wait for 10 sec5 q" ?; e- g, o" ^5 G) c8 ?
        if A_i=A_leave then send to die
+ N, _9 b$ m( ~9 ]2 M3 ?        else inc A_i by 1
% x5 @  M) ?& s7 Z& j) b: P. ]    end
4 |* W- `3 H# Eend

最佳答案

查看完整内容

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是个什么东东?
- i' ?( b9 g% g; g! P- mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?  N% [# F! |, L" ^1 b6 x
. F1 z% B! s  h; w2 u# G
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& L; W; o6 D7 I
; |  i" k+ d; g+ C( C# I' r另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# I' S9 h. e* W  X7 ]1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 Z7 i# d3 o# }: u! g' g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# [3 U0 X. [6 _4 u' w3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; y% Q& h% P8 }
begin P_induction arriving
2 Z! w5 Z  I% U; p, i0 _8 s" }    clone 1 load to P_pick(A_induct)
  z( I& a  a9 f  ?& R* ?+ p6 I9 uend最大的系
( b2 X+ S) Q1 p) \' }/ r$ g
% i; k9 i: \' v( Obegin P_pick arriving
- n. n) U1 O+ O' X    set A_i to procindex * 10 + 1
2 d$ R: a; B3 O4 D! T. I' \1 {    move into Q_induct(procindex): D1 J  n4 V* i( ]- z
    move into pickaisle.induct(procindex)
' a. @, ~3 g* r* s    /*check the type of pickaisle.induct(i), for your last problem.*/1 ]8 U$ C3 b7 r( m

/ K( h% i7 U& N$ K+ ~( t+ {    while A_i<=30 do begin- B, H/ ^7 _2 F
        travel to pickaisle.con(A_i)/ S) a' r, L2 I% ~  y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) t4 A. A* t7 w# @  ]# q3 X2 t
        else wait for 10 sec
* w0 L  U4 O+ ~( l        if A_i=A_leave then send to die6 X# u" A9 r/ c8 b* N9 U
        else inc A_i by 1
, K7 Y% Y5 e6 S) E/ R    end
# I7 _0 b5 m- e9 Kend* r9 q  M5 t2 v
4 K  R9 z5 s5 ^/ X4 F, P
其中的procindex为整形,代表当前process的序号。
' Q5 c* |8 w8 D: Y& A" f3 kstation和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-2-23 00:54 , Processed in 0.016781 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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