设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13404|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: r7 Q) V$ ?: a. z5 q+ R

' q( y) p/ \( n$ D2 L8 H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 E. Z3 M1 [' O' }) r1 \  U" _" `2 @& i1 b
begin P_read arriving
( s+ w4 }) q6 _! I6 A; @9 K& d: U    while 1=1 do begin
& j3 G* N. n% M1 ^3 h% s; F        read A_tote from "data.txt" with delimiter "\n"
" d$ b* P2 z; D6 M        read A_time from "data.txt" with delimiter "\n") [8 K$ y& A& e1 s* r- f
        read A_leave from "data.txt" with delimiter "\n"
7 A/ T1 o5 y/ o        read A_picks from "data.txt" with delimiter "\n"
  t. r8 C' u6 _8 ^) G- x- P        set load type to A_tote
! [/ w, u! P8 L9 ?+ z: J- k; i        if A_tote="tote 1" then set A_induct to 1/ U$ N1 ]: p# l3 w9 `
        else if A_tote="tote 2" then set A_induct to 2
& ?, r8 z$ e$ Q; j( P            else set A_induct to 3    ; x7 K3 ^7 ?. V/ e6 k% y  L0 p
        set A_i to 0
. a' A, _& e- D/ s( h% O2 V0 w        clone 1 load to P_induction
9 `5 Q7 G- s! Z! G, p8 o        wait for A_time sec- C% k" @1 F6 p- r
    end' P& ?3 I0 H9 e% G6 ]+ J/ F
end
, ]* C, B" Q1 f' |' X( l% R- }# R! O  i
begin P_induction arriving
5 J, G+ e8 i  f0 m9 v    if A_induct=1 then clone 1 load to P_pick1& N% B, B& i7 Y* O
    else if A_induct=2 then clone 1 load to P_pick2
9 W" L& |( G& e- U6 Z* y  J- `: _        else clone 1 load to P_pick3( x; q1 i- [3 ^5 j
end
5 y% |" ^; t% \) a1 C
+ C: a* C" i1 v, ^begin P_pick1 arriving
1 k2 K' c5 V3 p+ z( ]    set A_i to 1+ U& n  U. G6 `8 _" C
    move into Q_induct10 v, y( e$ @/ `& `/ j; T1 k8 p# h, E
    move into pickaisle.induct1$ m7 C* I/ b, R& d- Q. p& L
    while A_i<=30 do begin
3 ]# E6 b/ }+ D$ s' o1 Y        travel to pickaisle.con(A_i)+ K8 P& p! p4 J* M1 Y0 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 ~- r4 T" Q4 [- \  }' L  [. T
        else wait for 10 sec9 B3 a5 b# {0 P4 q. b
        if A_i=A_leave then send to die
: j) `. s" ~! ]        else inc A_i by 1
$ {: r! T/ `! z3 y8 ?9 [; t    end
$ h, Q, L, q+ j( R; r! J' vend+ j0 N3 e* d6 ?. ^5 u/ n) a
- U/ |- {8 f* a/ J& {3 |/ {
begin P_pick2 arriving
4 \( d9 ^3 ]: l) {( [    set A_i to 11
+ N3 k2 N* Q9 f7 i! Q$ Q  u    move into Q_induct2
- g+ c5 _/ G" g1 T    move into pickaisle.induct2& q7 g/ U0 P+ J$ c* B  S& \
    while A_i<=30 do begin
5 l: ?+ E2 n# `        travel to pickaisle.con(A_i)) T( S, h+ \* b) X! C9 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ l: I/ W& l- K1 W4 Z        else wait for 10 sec
% r* V7 c2 {; m. f% _/ J        if A_i=A_leave then send to die
/ T$ f" h+ |% G7 H6 @! g1 q        else inc A_i by 1
8 O. b( C! ~8 ?' d# z& r    end9 P9 n! T6 R* ~. a# o8 r1 {5 j& m! h
end
7 j" Y  ~5 E% i1 f. [; N, J% V( E* h3 B1 J/ f! D9 q
begin P_pick3 arriving- L' z6 m$ u# @5 f
    set A_i to 21, C6 h( a3 }9 N& N: Z
    move into Q_induct39 b) d5 @/ @, b/ @8 M) ~! B5 t
    move into pickaisle.induct3& h2 f; O& ^( a4 \5 Q& K
    while A_i<=30 do begin
8 j0 |& r( O0 W        travel to pickaisle.con(A_i)% I0 S2 |/ z8 y9 q" w2 z+ y# o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 p6 |2 \8 X: {5 N" |; A1 E/ M5 V        else wait for 10 sec
6 k6 z% ~$ [8 p3 r! W: M5 d( Z# e        if A_i=A_leave then send to die# |$ Z5 w; Z: {! W
        else inc A_i by 1' |6 {4 K2 c8 Q, t. _3 [! n  z. [
    end
, I/ a6 V' e) W* Wend

最佳答案

查看完整内容

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是个什么东东?7 R& s- [; Z% w3 q4 I' j# _
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 p  e7 e8 P( O! l9 B/ q

4 p9 k5 h1 ~3 m8 T, LAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 H+ {9 j5 t; z. k4 p1 C+ m0 @  e4 b5 X# j6 B/ x
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 t3 k# O; G# T7 Y* R. o+ e1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;( v1 t' L) q: ~4 S2 w: y
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" p3 Z/ G/ \8 p7 y4 V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:2 {! Z! o1 \1 O
begin P_induction arriving& ^1 Q9 C6 {5 ^3 u- z
    clone 1 load to P_pick(A_induct)6 V  K6 K9 |( y- W7 ]+ o8 c
end最大的系! Z. e7 X9 o4 b; w0 U
/ ^+ H  p& t* y9 v9 S( B
begin P_pick arriving
( |, ?3 R3 c1 P( _    set A_i to procindex * 10 + 1( d9 ~  {9 S1 U
    move into Q_induct(procindex)
: q: w/ ]" {7 z9 Y; l: {    move into pickaisle.induct(procindex)
" Q, R5 [: v- @. Q" s2 ~    /*check the type of pickaisle.induct(i), for your last problem.*/6 j; x" L& X' u9 ^, s

0 v' R6 s( }; {    while A_i<=30 do begin
! S% p& c. U" ~. g        travel to pickaisle.con(A_i)
6 W9 M: C) v) t5 e( F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# x) U2 h9 @+ Z- p& m) s" W, s        else wait for 10 sec
7 z; H0 T3 |; B5 z" q        if A_i=A_leave then send to die3 L$ f) A+ V. A& e
        else inc A_i by 1
+ J4 K' Y$ L" U/ D2 K; }$ U    end
2 T! y# S. Y5 [+ Q; F  w5 _) Lend! e) K  g; D- ]4 ?7 {) H3 v
9 L' s2 {6 s" V4 \2 h: X/ {
其中的procindex为整形,代表当前process的序号。
3 g3 X* W, t% N% x' G- e2 Lstation和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-4-10 20:11 , Processed in 0.016603 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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