设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15286|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% L" n2 }; z' _, V  Q0 Q
% P' F! ^0 d3 f我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* X: H- v9 g: e$ r' j
! `! b9 X; ~6 F' Hbegin P_read arriving
) ]& S' H! a+ ?$ g4 a    while 1=1 do begin' ~4 l" C7 X5 R& E2 Y7 _! K) B" [/ F
        read A_tote from "data.txt" with delimiter "\n"
' y; g) d0 W; B* o! l        read A_time from "data.txt" with delimiter "\n"
. x( e( P" Q( q  d4 O' ~" z4 D        read A_leave from "data.txt" with delimiter "\n"
9 Y! t5 |7 p0 Y; F        read A_picks from "data.txt" with delimiter "\n"  N3 N0 T$ F+ R
        set load type to A_tote, G) k5 C6 t. A  c  `( d
        if A_tote="tote 1" then set A_induct to 1/ v1 ?; ]) Y4 F; D6 B
        else if A_tote="tote 2" then set A_induct to 2, I) d1 ?' F3 \- U& C5 J
            else set A_induct to 3   
% y  X1 {' O; P9 S$ w' h2 l* U        set A_i to 0' M" Y' D" Q1 H+ F7 O1 \' ~
        clone 1 load to P_induction
( y3 F) p6 W7 V        wait for A_time sec" g& A9 q! o1 U- _2 _5 l; v
    end
; ~6 m  ]( Q7 _3 P# Aend
9 }/ w# n' h) x+ e) I4 c' ^7 ^$ H( D" o
begin P_induction arriving( G* R. d! K( e
    if A_induct=1 then clone 1 load to P_pick1+ D1 s* T& F( U
    else if A_induct=2 then clone 1 load to P_pick2
' l6 }) W, }& _4 x+ m5 j        else clone 1 load to P_pick3
3 K6 K8 y) ^( c3 r" Z3 `+ B# |end
$ ?9 q1 K" _+ r+ F
' C& h0 \: _' G4 \3 y3 w5 wbegin P_pick1 arriving
; q! v) W- o4 ?2 o( ]8 M7 t$ {" L    set A_i to 1! H+ {1 p. P3 ?# o
    move into Q_induct1! ?0 y0 r6 M0 ]" X
    move into pickaisle.induct1+ v: r8 a" [; q( `
    while A_i<=30 do begin1 A! B' j5 y- C* n. C
        travel to pickaisle.con(A_i)
) R! ^& m' j" p1 B3 `$ o( Z% Y+ u" E2 U) S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. T+ J  b% _, c% X
        else wait for 10 sec
: \& Y$ |. d* Z+ z        if A_i=A_leave then send to die
0 t* O, D/ K& p* D4 z: d! a        else inc A_i by 1" b( P5 q6 L' v2 Q% y, N
    end% ~: C' ?, Q- p, ]0 E, a: D" g' ?
end
& Z" Y; |1 t6 A5 K' H
" s( m2 N) ?& ~8 B9 N; g3 x5 q0 lbegin P_pick2 arriving8 d1 Y9 N& f  R  ]
    set A_i to 11
* |) Z9 O" R0 m0 |* s6 ?) y6 o    move into Q_induct24 q$ {" W' d/ X' O4 [+ \% G
    move into pickaisle.induct2  H& O8 J' _, j4 F$ o0 Z  O  H8 j
    while A_i<=30 do begin
+ j& K: h9 X6 F- Y4 \3 F, i        travel to pickaisle.con(A_i)
3 \0 x0 T" H3 T7 z* w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& @. w' {6 S; U; V7 U
        else wait for 10 sec  w; x9 F3 Z4 N5 G% {5 y
        if A_i=A_leave then send to die  K1 X; W9 z! p8 L/ }8 |
        else inc A_i by 19 B  P, {# g( z: W
    end+ Q; U# {  {8 R- D' e. I& b2 S* S1 }
end
. q; T1 v0 J0 G5 D1 k+ g, N
. \( L5 o9 v- ?& n4 b/ Obegin P_pick3 arriving
. Z" n7 Z+ Q  i    set A_i to 21
* {7 p& e- ?. z  v, w, Z( Q  i    move into Q_induct37 B2 f$ \- K2 L, }
    move into pickaisle.induct3( n4 V, y5 V' y
    while A_i<=30 do begin
$ a& Z7 J: b; y6 Q. O; }0 k4 G8 [        travel to pickaisle.con(A_i)
0 J6 M! h- S2 e8 w5 ^* J$ w  Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 c9 V1 l# a5 C- s8 h" K6 y' m
        else wait for 10 sec) x4 I5 a( n6 x4 o! o1 P/ ?
        if A_i=A_leave then send to die
$ |3 w9 ]! E! [        else inc A_i by 1
  B" ]+ @6 m  O& X    end
4 W+ \0 u) T1 u4 gend

最佳答案

查看完整内容

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是个什么东东?2 T$ `; l+ O5 m" m8 P$ r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& X! p6 Q! U1 e

8 t9 I0 C" g5 K+ eAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 e! J& R) y( y0 L
9 f- i% `/ @8 ?6 e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& q+ T. u7 V; {: V" P* ?2 `) S! O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 D  ^; |% u7 ^3 W% g4 _
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 y$ L% d# w0 n3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:% L! u" @/ H2 Z! d7 P; u
begin P_induction arriving% M! z) c5 I! P1 A! m
    clone 1 load to P_pick(A_induct)- M8 e1 @& f: b+ X' u
end最大的系
7 J. _% V9 @6 q0 h. b4 M' J& j1 X* G
begin P_pick arriving8 O1 c. S3 g* Q
    set A_i to procindex * 10 + 19 G, j5 n7 b/ S6 [, X
    move into Q_induct(procindex)* {5 K0 c, w6 f! H
    move into pickaisle.induct(procindex)
. w6 P' c( o. ^    /*check the type of pickaisle.induct(i), for your last problem.*/* c  A0 M& |' w: E
5 m, M# H; [& `, f6 T
    while A_i<=30 do begin
9 @+ {+ K: h7 [- m! i# n        travel to pickaisle.con(A_i)0 o8 B# B& a8 O. |& x( X5 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" ?' e. P* M4 E, I, N        else wait for 10 sec
% G' X1 N8 O. S        if A_i=A_leave then send to die
/ t3 [% o2 A: F0 L1 D1 f        else inc A_i by 1
; _6 {0 m% f' i8 t# v+ x7 T    end. x+ v: g0 U8 w$ l3 N$ z
end
2 L, x' w9 b% I
) R1 Y0 z% j, R: i; J其中的procindex为整形,代表当前process的序号。- q; `1 N: @; z$ a
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-8-30 04:18 , Processed in 0.017057 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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