设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15140|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; P) P, f) f. Q, L9 Y" z# |% M% |: C4 s- 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中的数值,不知道会不会有什么不妥。3 s+ p9 i* F: ?$ Q/ J

- c/ a: n! ?" V. x' u; Y- x5 qbegin P_read arriving( m4 l# X! n. G( L' z
    while 1=1 do begin
$ K  c5 y0 j. v1 g% X6 n& u  ?        read A_tote from "data.txt" with delimiter "\n"5 j3 J, ]# z1 `. T! a8 @' D
        read A_time from "data.txt" with delimiter "\n"" L5 P3 c3 h, e1 _- T
        read A_leave from "data.txt" with delimiter "\n"
0 G- D" ~% e( t" v4 n        read A_picks from "data.txt" with delimiter "\n"
" {, z- \) u- p2 \* z        set load type to A_tote( s$ ]9 a& a6 ?3 M+ ~- b$ b- B+ m
        if A_tote="tote 1" then set A_induct to 1
( e/ P3 Q$ l  R/ w% W& k7 s& C5 S3 S2 ~        else if A_tote="tote 2" then set A_induct to 2! N% q% N2 x9 R: B$ E& v" g
            else set A_induct to 3    ( H% Y& ^: J; K( F! d( h" P/ F
        set A_i to 0% k# `& Q; f- D$ T
        clone 1 load to P_induction+ Y  u' y) t% Q: h- i; I8 w  ~
        wait for A_time sec
8 D9 d# @. s" M$ A    end
8 H# l: x  C  g* Pend
+ ?/ ^" d( r3 N% b7 f5 A* L# ?% S2 X2 l1 {
begin P_induction arriving
: W5 D) G+ F- B" U* H    if A_induct=1 then clone 1 load to P_pick11 V) C! g+ B& h; o
    else if A_induct=2 then clone 1 load to P_pick21 t2 F/ U- A( \3 j* I- O2 R) s; c1 m
        else clone 1 load to P_pick3
# Y% \/ |% c) o8 L" Hend
3 H4 p( `& _4 j4 r* H/ `1 i( P( n- }7 E* j+ r' p
begin P_pick1 arriving
+ \2 l3 q0 z0 C( l! J7 \; |! E    set A_i to 1) |9 B% J2 M. F: Z- p
    move into Q_induct13 p( Y  y* O" k: T' A2 d- R
    move into pickaisle.induct1
* W1 P, z: `& u0 B    while A_i<=30 do begin; r6 K5 k4 c9 G0 B. f# m- j
        travel to pickaisle.con(A_i)
( l( K! C9 i  y' F+ m7 r% L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Q* v/ A) a- P  V$ s% ~
        else wait for 10 sec( ~& u+ T! P/ f- Y
        if A_i=A_leave then send to die2 }) x' X0 H* r! z: L+ B
        else inc A_i by 1
, E- E0 U+ `, Q$ g    end8 R6 c9 j) d7 Z) F- W
end# m/ \2 ]. g  b5 v
% [" N  e5 _; m6 s; \- K8 d' N# H
begin P_pick2 arriving
* ^) Q, d0 x- Q" c    set A_i to 11
) J% L* [" o& b. H- L0 b  v    move into Q_induct2
. i. e% x5 n+ O& G. K: |4 w6 `    move into pickaisle.induct2$ I4 _' s( T' Y3 t' `1 I, q2 m
    while A_i<=30 do begin
! C/ B; i, L" Z6 P: u        travel to pickaisle.con(A_i)
! H0 I( H7 q& v# A) m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) P4 P, T" r+ x        else wait for 10 sec( u9 W+ j, c8 e
        if A_i=A_leave then send to die4 K2 N* U6 K3 w9 h
        else inc A_i by 1, X6 [( a" D- K/ f, u0 j
    end  [8 e8 w& l' b( T. x/ |1 I
end/ d1 e, x+ O; O
) z5 J+ r; ^" v4 m1 O% k% Z
begin P_pick3 arriving& \( e4 y8 j! E: O
    set A_i to 21
4 E5 j7 ~  O( H, k    move into Q_induct3
% @3 K; m# {* k7 E    move into pickaisle.induct3
+ G$ p" |) R/ X7 k    while A_i<=30 do begin4 p9 ^0 G6 Q! J9 T8 b
        travel to pickaisle.con(A_i)# W4 Z- x6 Q6 z. V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, c4 U5 i" D- l+ U5 c8 y) c
        else wait for 10 sec
; Q/ ?  s2 }& U        if A_i=A_leave then send to die( ?% k. }& y$ B9 q5 y  H3 W+ F
        else inc A_i by 1
/ s6 N4 u1 C4 {# N7 I) Q    end
% ]0 H( v% X- d  @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是个什么东东?' ?' k! b- A3 v2 c6 O4 G0 a% m5 f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
; B) b, G- T* ?9 l9 p# X- d& Y3 H1 O8 @) y: o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
" t: I) {& ]- _# R' r0 T6 P- `1 D- W! \5 o/ A# T, q3 ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% b8 G- v* B/ A1 ~5 O2 G7 l' d
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% q' j% _2 |8 s3 y% Z* I$ Y5 g+ A2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. @* b9 ^  H+ U3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
; M0 U+ v8 v$ n  d, Zbegin P_induction arriving% j8 r4 \$ n1 n7 E) d
    clone 1 load to P_pick(A_induct)
8 [6 D, w# w) p5 Send最大的系
1 P- S* Y+ ?7 {6 W6 h3 Z$ A; F3 W9 ?7 `3 E4 ]# E
begin P_pick arriving
* J3 j- e/ w0 V6 r: r# f' j3 d    set A_i to procindex * 10 + 14 q8 K! \4 U9 Z
    move into Q_induct(procindex)
1 t: i2 {' J/ ^! T    move into pickaisle.induct(procindex)( S5 ]* \) ^; i, _; d; u2 l
    /*check the type of pickaisle.induct(i), for your last problem.*/  }! C% \" }! {8 {3 D- `
( o6 p' N# N% x, b
    while A_i<=30 do begin8 |3 I4 Q) V1 F8 r& s
        travel to pickaisle.con(A_i)
+ v# J, P! w7 v1 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 c7 f: N% b- S" Z  a        else wait for 10 sec) E1 l9 c+ s3 _9 r) d- x$ m5 [3 k
        if A_i=A_leave then send to die
' ]  c& a; W$ D: i" ?% G5 h( @        else inc A_i by 1
8 i% b  t% c+ u/ Y' H1 m5 B' W! j7 I    end  a& N  c2 K% Z, p8 X  W
end1 ^# y! M+ O. w: D
$ f# g. Z4 ^1 G: t* x6 Z- c
其中的procindex为整形,代表当前process的序号。" I) L0 L3 x- e. _% f4 ]7 r
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-14 05:54 , Processed in 0.019996 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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