设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14913|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ R) f+ f3 @; f; o# p( t, T+ g# w

3 J( K/ K* l7 Y5 ~8 G我的问题是,在每个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中的数值,不知道会不会有什么不妥。: s& ?, L( A' {

6 B, d, n/ J9 ?begin P_read arriving% r( D: Y$ Y/ J$ I6 u3 c  |
    while 1=1 do begin6 C6 @: w, s9 Y5 l' m
        read A_tote from "data.txt" with delimiter "\n"# R! s+ e) B+ e2 r+ J3 s
        read A_time from "data.txt" with delimiter "\n"
3 c7 H5 W6 j9 ^' S3 O/ `; M        read A_leave from "data.txt" with delimiter "\n"+ k3 V5 Q; k; d6 h" ~1 y1 S9 B/ ~: E
        read A_picks from "data.txt" with delimiter "\n"
, Q4 a" h$ `* u, X0 b6 A5 f% ~        set load type to A_tote
  n( z9 b) u# T  @, r/ U        if A_tote="tote 1" then set A_induct to 1" Y, b, N5 h; t! |' n# e( D+ ~
        else if A_tote="tote 2" then set A_induct to 23 C2 W1 p* ~* T3 s' Z$ r
            else set A_induct to 3    8 b, I: X- g; u3 \
        set A_i to 0
; X2 T* X: Z9 T/ `+ N. i7 G) p        clone 1 load to P_induction* {5 A+ P2 O- v8 e: O
        wait for A_time sec
5 O/ A1 f+ \& k! x* e+ L% F9 t    end* d* ~) P/ N1 n' {7 F
end
; f/ j- K5 A* w% B5 I9 \  v- ~# X6 `1 a. T
begin P_induction arriving! U5 z( [6 b4 e% Y1 T
    if A_induct=1 then clone 1 load to P_pick1  }3 r; h- E6 z5 g3 q" ~: W
    else if A_induct=2 then clone 1 load to P_pick2
( @0 R$ v1 I/ Z4 _) Z% L        else clone 1 load to P_pick3
  e7 r5 t- Z7 C9 B9 ^  w' f7 D9 Zend
" y" Q7 ~8 c8 n$ m- a
8 s% r5 }4 q1 m* ~begin P_pick1 arriving6 p( Q4 W/ V$ m( ?
    set A_i to 1
* i  R# @( l5 P& I+ u7 Z    move into Q_induct1. P% }! z' i: M+ t& v' G' R0 V+ J
    move into pickaisle.induct1! c: V" m1 |; c) ]' {. Q% K, a
    while A_i<=30 do begin
) i9 z3 L5 v: e: ~6 _" \: B        travel to pickaisle.con(A_i)/ ~' W. d/ |  j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ b& w5 G- [- Z2 m" y6 \
        else wait for 10 sec, L* R+ l$ s$ a$ H4 I
        if A_i=A_leave then send to die
* ?2 q7 u$ H; d; m" P" a        else inc A_i by 10 `( S' `0 D% N) d7 }% p
    end$ T/ ^4 {% `: j9 {( a& B; ^
end
. ~& _8 k. i' a7 I5 F, U! E' n  r, Y1 `6 W
begin P_pick2 arriving
0 w& K8 m0 Z, W( J; P    set A_i to 11
. m6 T0 Q' F0 p' y    move into Q_induct2
. g- z, m4 B; L    move into pickaisle.induct28 f0 O, P0 _/ u- h- Q! y
    while A_i<=30 do begin) Z( M! L( R$ J9 W" V4 r. [4 Y
        travel to pickaisle.con(A_i)* G! l9 X3 e3 R0 H/ ?" C5 r# @# @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% p4 g% Z7 G  v* w
        else wait for 10 sec% p( g1 H  O& r3 x% r0 ^
        if A_i=A_leave then send to die
: R- ]) j6 x, a  u* |. j        else inc A_i by 1
& V$ \. `1 P% ^    end9 e# S% i+ N; o" A. D* Q& c
end
6 K* G' t: _# W( F* c
8 n% C# k/ x7 Q3 n: Dbegin P_pick3 arriving3 `; m6 P% }8 R- g2 W& o: I
    set A_i to 211 a& e  g5 o" _; R. R# a/ o  a% q' X
    move into Q_induct3% {# ~  k7 Y# N$ V* M* v" v" a" {
    move into pickaisle.induct3
: _2 n+ e; e' D: u    while A_i<=30 do begin) B' X9 b! j+ \6 |1 V
        travel to pickaisle.con(A_i)
$ |2 L) i5 j/ p$ ]4 A. H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* [3 @) t6 L6 [2 ]9 p8 N$ E# |        else wait for 10 sec* e: W5 o# e4 E% K- r  q, v
        if A_i=A_leave then send to die
4 G- l, E$ d9 ]; T        else inc A_i by 1
  x( _9 C$ J0 j) E5 K    end- F6 a5 A) ]- s: c
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是个什么东东?
! u6 M) T3 g0 E! `6 _0 Jmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; m+ E, i0 S% a3 H6 n) z
  h) L$ y' o& k9 K5 b. ?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  J3 G3 d. V3 E. y- _
: S/ g0 t# T0 i! e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 q. ~" e4 A- i( u. J- d1 E+ o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& `) [+ k$ m) {5 T& e0 t2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
! g0 b# x1 u3 T' [+ ]7 f3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; Q3 ?, F& E4 ~5 {begin P_induction arriving
1 A, p6 ]+ `0 q. t  ?9 R! q* `. R- S    clone 1 load to P_pick(A_induct)
4 |" N& }! d, r0 Z& U$ `6 Vend最大的系) O6 |! l" Q$ c6 V+ g) [

7 N  G: b6 n* p7 A/ l( Lbegin P_pick arriving
* @5 m7 \1 Z1 H* G* A6 Q    set A_i to procindex * 10 + 1( Q& L( D2 a% H9 Q, N
    move into Q_induct(procindex)3 s: k: }: b+ Q5 T
    move into pickaisle.induct(procindex)
0 ~6 [1 S. _) @; G6 J    /*check the type of pickaisle.induct(i), for your last problem.*/
- @0 R& Q3 D4 G) x' ]$ i  B! L% Y: E1 {
    while A_i<=30 do begin6 }: S2 p2 T) K, r. ]% B. W  h
        travel to pickaisle.con(A_i): M; g' W. f* v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# v3 r6 j  d4 O" {4 E; Q$ `        else wait for 10 sec
. A0 l. x" a) V  K. e6 x- c; [$ U        if A_i=A_leave then send to die; ^& v$ i  Y- ^3 o# M7 g, a0 v$ d
        else inc A_i by 18 \" H5 X$ [8 w+ C4 ?6 ?6 x
    end7 l' G& `. S2 ?: S" K* [
end
0 ^0 }8 {( q9 r- b2 G& Z6 X  p8 {8 ?7 v
其中的procindex为整形,代表当前process的序号。4 k' U; a2 y; p7 q  d8 w2 u
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-7-31 03:59 , Processed in 0.027807 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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