设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12764|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ R( L6 T: ~% K( S, J
: o' ^% ]# G4 I7 o( b& v4 q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# |+ n: c/ W9 {

" z% o  a4 z0 g4 C% A" I$ o8 Fbegin P_read arriving2 L( F) `, ^* d' a
    while 1=1 do begin, x7 l& i1 E/ U/ l$ @& r9 z$ ?
        read A_tote from "data.txt" with delimiter "\n"
' A. U: C; W" }. Q$ d        read A_time from "data.txt" with delimiter "\n"2 r( V7 n* ^& x) h: p: g
        read A_leave from "data.txt" with delimiter "\n"
4 }# m) W3 s8 }1 }# o  p/ f        read A_picks from "data.txt" with delimiter "\n"
1 z& l0 Q  ~; y8 X5 A6 C3 u& |2 H1 q        set load type to A_tote9 J" i! B' `! g0 ^$ ?% p" N- W
        if A_tote="tote 1" then set A_induct to 1
1 H6 ~4 b0 }  B. H6 r- A        else if A_tote="tote 2" then set A_induct to 27 P4 }' x* S/ M  g
            else set A_induct to 3    ( \1 g/ h/ A* ?' f" O
        set A_i to 0, B+ P/ C+ v8 k+ U, D  C/ p
        clone 1 load to P_induction
( U8 z) y2 E, r) v0 o2 r; j        wait for A_time sec1 \* c0 N$ G' |- {! @
    end
7 m3 @; p. y9 O* Xend
6 `  K" n' j, m5 }' s  w( R- |% N3 j4 c% ~  h" B/ ]8 S4 y
begin P_induction arriving# L, C$ a5 a4 E6 b: B, g
    if A_induct=1 then clone 1 load to P_pick1; k+ Q3 f5 {. q  n  s( z
    else if A_induct=2 then clone 1 load to P_pick2, J' c# p2 A5 c/ b& K" L
        else clone 1 load to P_pick37 j: x% E) U7 d( T6 f
end/ J! b" s2 ?' f  G3 h' D& l6 n
0 I" j5 |1 W) M' V5 n9 s) h$ s
begin P_pick1 arriving
/ a+ O& f! G: K" {. O1 ?    set A_i to 1
- b9 O, E+ h# J2 I% E    move into Q_induct1# J. e" k6 G& q* g6 J
    move into pickaisle.induct1
/ m) s5 r) t- v; F    while A_i<=30 do begin
. y: x5 J: a# ^5 W        travel to pickaisle.con(A_i). D; F! v. J/ L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* h! U7 J5 E- T" l3 A
        else wait for 10 sec/ r. v/ G% j2 ^/ b6 l
        if A_i=A_leave then send to die8 Y# o' c' y, e; l! P/ E
        else inc A_i by 1
+ v( k0 D4 H( T    end
, _$ }5 ^0 P0 F& V+ Q) d+ G& Fend0 A% d- H  `* _( l" g% K
( f) m1 c% Y' n& x( P7 ]$ C
begin P_pick2 arriving
% H7 ?: y$ @0 K( ~8 }- i" G    set A_i to 11+ l- L0 l- C: y# n5 z! n8 [
    move into Q_induct2
& P8 P0 G+ q7 J    move into pickaisle.induct2! h& c4 D8 K) h$ U+ E% q' E& x
    while A_i<=30 do begin# W; p& [7 h7 B6 m
        travel to pickaisle.con(A_i)
, V; m/ i' I+ B2 |' ]0 a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( a- f3 v8 b+ q8 K+ g% Z) Z
        else wait for 10 sec
" {7 @* h; o" A; c1 h. F: J# ^+ V        if A_i=A_leave then send to die
  w' A- c' P! D3 ^) v        else inc A_i by 11 ~, k# |8 {4 \+ M
    end
9 ^6 i) d" H9 c: [end* S% i1 a# s% t9 I' D% K1 }
; ~8 Q; X3 c+ b5 A: D
begin P_pick3 arriving" w2 z6 m) {# w. H# [6 x9 G
    set A_i to 212 X: {% g, l; L- J" \8 Q
    move into Q_induct3
5 |9 A* Z3 b- {3 G% p7 \9 X- x3 g    move into pickaisle.induct3
: w% X& G6 x! P& b7 w) L" f  \9 x    while A_i<=30 do begin" U6 s+ m7 P" G0 m7 G
        travel to pickaisle.con(A_i): [: @+ w* x8 x: q& S! k. {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 D: b. l1 Y0 O0 O6 c& D
        else wait for 10 sec
  o1 ~; v' M. e4 z' {+ F7 s+ Z        if A_i=A_leave then send to die
; }: j1 I  i4 f        else inc A_i by 12 M( G( `, g9 `: V& Q% e
    end
! P( d& v( `) ?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是个什么东东?( w; Q9 J  I! F8 Q2 T4 X; K
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?! j+ M# ~0 J$ F0 a4 ~  k- A2 ?

6 M: a6 W) D4 dAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 `/ ]; ~3 w5 i. C

+ ~" r* T8 O" z, J8 M9 s另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 l* }7 `6 ]2 ~1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& @/ r/ {% u5 G+ W" C2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 [5 o( O" T4 }5 S% B9 w  O+ |
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ V" }; R2 o, \5 T4 j% Xbegin P_induction arriving
' F0 a$ d. c7 H3 e    clone 1 load to P_pick(A_induct)
4 U6 V. H! a, G5 _" e! r* T% O( C% [4 dend最大的系
  B# h  j4 I0 w: }" t2 Q4 D! e% w0 N" o" i, |7 u& z
begin P_pick arriving
( K" i6 L3 t3 O, P$ C    set A_i to procindex * 10 + 1
8 b, p) `: ^* H    move into Q_induct(procindex)
4 A+ X; g/ C0 V- W    move into pickaisle.induct(procindex)
8 q+ J" v% m+ Q" Q    /*check the type of pickaisle.induct(i), for your last problem.*/
$ Q$ o9 Y/ C: g- @/ G9 X- {
, ~$ p9 y9 u' N" b$ c' N    while A_i<=30 do begin
0 n* \- M/ [! C; d! ^. v2 k* g' c) |        travel to pickaisle.con(A_i)
0 v# A& g- ^: |! w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ ?- N8 P0 w, K4 i; r7 p2 {1 z
        else wait for 10 sec
  x/ \9 w3 w- |7 W" g        if A_i=A_leave then send to die
4 \8 P8 m4 E. Z0 `        else inc A_i by 1
- W, p! c1 T, e" N2 C! [4 ?    end! ]8 ^+ b; O1 J) l
end
1 Z3 q- H- J, y7 f$ G  p* o. V! V4 n+ V% }: T* b! |" E3 B
其中的procindex为整形,代表当前process的序号。1 ~" J8 z. x5 }! H% f
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-2-18 12:15 , Processed in 0.015033 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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