设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12317|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# d" r# K+ {, x7 M8 a9 i/ u$ M; y
* I3 \8 G, j' s% {% ^我的问题是,在每个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中的数值,不知道会不会有什么不妥。) X2 A0 O8 X& f  V1 u: P. B

: T; n' t1 w3 G2 Kbegin P_read arriving' E% Z$ C$ n2 G2 ?; W3 ^
    while 1=1 do begin
! g3 J3 L; ]. @- v' w: ~- m        read A_tote from "data.txt" with delimiter "\n"
0 H( [% I. R; |2 p        read A_time from "data.txt" with delimiter "\n"
5 I6 a! c: F1 s% [- y+ J# ?: Z7 |        read A_leave from "data.txt" with delimiter "\n"
$ n4 s# \/ y2 \8 z: b( s" y: v9 {        read A_picks from "data.txt" with delimiter "\n"$ P% D2 E+ v6 D: I& C! N+ W; I
        set load type to A_tote2 ~! O% X% m  x, P& n
        if A_tote="tote 1" then set A_induct to 1
* H. ^& `7 [* t6 h. U: o3 X# e        else if A_tote="tote 2" then set A_induct to 2& x6 H; [5 k4 x3 O3 m( ?
            else set A_induct to 3   
: D$ x5 q2 d! g8 y& |: a1 h        set A_i to 0
" Q2 w# }) S3 t# o        clone 1 load to P_induction! Q5 [6 x( }+ {3 t( ~: [
        wait for A_time sec! S  C6 Q: a, X/ }" E; X0 j) r
    end
; a' c& X$ A- t# K+ n6 Vend
& v. }7 E1 V9 r+ X0 i& X& Q  L, O6 |' m) G7 L+ Z5 \
begin P_induction arriving1 W+ M6 O* `  e5 [* n" o
    if A_induct=1 then clone 1 load to P_pick1
& C4 e% d% i% p. x: U2 k3 I    else if A_induct=2 then clone 1 load to P_pick2
6 R8 Z) L5 C% G4 a- |- H        else clone 1 load to P_pick3- m: Z5 C7 h. V5 V
end' ?9 X  z; j- B& l$ R5 W- W
) p5 N5 n2 U: q: _$ a- }
begin P_pick1 arriving& o. W4 |8 M* r8 M( o" T
    set A_i to 1+ V8 X8 j; k) f4 M7 M
    move into Q_induct1
1 a; L; g' H' U; o( P9 V    move into pickaisle.induct1
* a6 S; t0 d  V' g/ x$ ~  b    while A_i<=30 do begin4 d& h( ]' A$ a9 @" Z
        travel to pickaisle.con(A_i)
& X# t1 G3 ~. _2 P# I* [) ~7 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" a4 J6 H+ q. N" p( s
        else wait for 10 sec
$ v& P" j# A* O% L        if A_i=A_leave then send to die( D9 X  S( I; [- y, n
        else inc A_i by 1- J. q9 z& O) N: c8 l6 i( C/ r
    end$ z) w1 ?1 J: ~; D! ^
end
( R9 `0 s4 ?6 o$ W' X9 _, v* [
  P- _* X9 E( Qbegin P_pick2 arriving$ d" P3 Y# N1 ^5 Q
    set A_i to 11( W1 S2 A& r/ g2 M, Q* [  D
    move into Q_induct2
" ]1 ~2 r3 ?2 c    move into pickaisle.induct2
! A7 S7 G) m7 e6 `    while A_i<=30 do begin
' q2 M  Q- m1 u1 ?' |  d! T5 K        travel to pickaisle.con(A_i)7 E# L4 t1 T* p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ w4 S2 k8 D+ Q3 ~7 c
        else wait for 10 sec# q2 J: B" P1 J% g  Y
        if A_i=A_leave then send to die
8 Z0 j, t3 Q% J6 c1 g/ s$ `        else inc A_i by 1
  I/ l  W8 }/ q6 K$ N: ?    end
; a! D6 F; X! Mend. f* Y! |; q0 e, N1 i
9 u' Z' F4 b" X$ C
begin P_pick3 arriving7 _0 \, _. D/ @3 W; t
    set A_i to 21, c3 b, ~8 u; d3 N. u
    move into Q_induct3
6 \8 v: d+ H$ I: ]/ N    move into pickaisle.induct39 z3 z+ S& V. W& R
    while A_i<=30 do begin
$ N  H, |  S1 p' x+ W. S8 p        travel to pickaisle.con(A_i)1 s0 J: \- `8 {/ X$ p! C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. H8 y2 `1 v8 {5 ~% d; c
        else wait for 10 sec: w9 V3 x2 I& K3 h7 r
        if A_i=A_leave then send to die
/ ^" O4 X! o% e) L; w& A        else inc A_i by 1: D* }9 T% v, F8 e! c
    end4 t- W; h6 R1 }$ Y
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是个什么东东?# v. b8 q8 U- _+ O3 ~% W& `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ ]- r  o1 V" y% }' k# Q$ m1 l
) H/ d, w- D4 \6 \; g+ d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。! ~& j9 X3 J: T( F8 M5 B

, m0 j( F; N7 m" o/ s/ K另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 W9 I3 k: ?% V" J9 r3 E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ k! a8 b  h" Z# r2 m6 g2 \/ T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
% b" T3 |5 {: w( x  ~; l3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
" F, Z1 n+ d7 Cbegin P_induction arriving
9 L9 t' |* a, M4 o' H: p    clone 1 load to P_pick(A_induct)$ T; [  L  L2 q. a5 r
end最大的系2 }& k3 c1 P7 S7 Q

) Q5 `  k) i$ q  @' ]+ s$ Pbegin P_pick arriving, x/ @' l& E0 i: p) Y
    set A_i to procindex * 10 + 1
" y* |9 n6 p" O$ f    move into Q_induct(procindex)
% p% t8 U: q7 Q) _4 _/ `1 x- K6 ]    move into pickaisle.induct(procindex)
4 d1 x+ y8 G* F1 G' R& N% M    /*check the type of pickaisle.induct(i), for your last problem.*/
1 J1 r( U8 z; [( \" m
/ j! w+ u( @) f, a7 r; @$ K  l    while A_i<=30 do begin
6 S: Z% Y" c2 j6 @5 V        travel to pickaisle.con(A_i)
: k( y- z% ~4 c+ c5 L2 S# _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ B4 C' I& X+ y! u* ^  g        else wait for 10 sec6 f, F: P3 N8 _3 ]
        if A_i=A_leave then send to die, m) }- }* l& A# J2 ^
        else inc A_i by 16 m5 N! e" ?9 `; P  v+ f  n) Y! S8 a
    end4 K( N# ]/ p& j8 B8 w
end
% u3 E, z' k5 i. b* R! D: q5 ?( K2 d9 x
其中的procindex为整形,代表当前process的序号。
  e8 E# {  ]0 i) 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-1-13 10:46 , Processed in 0.015785 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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