设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11788|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) Q  u- A( E, b8 ~# T# F6 y
% z7 g8 F, D( Q2 p8 K1 [我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 b7 l* K" l2 s, f5 f# f
5 Q+ R2 q' j5 e2 ^
begin P_read arriving
( B' O. |1 ?/ s' m0 M7 B2 G6 ?    while 1=1 do begin
& B$ i- k4 H- U4 Z  H        read A_tote from "data.txt" with delimiter "\n"' m2 r# X% k" p, ^8 Z
        read A_time from "data.txt" with delimiter "\n"
3 k1 b% E8 Q/ o; o8 j        read A_leave from "data.txt" with delimiter "\n"
: T& z  `. k# H$ N& j) @        read A_picks from "data.txt" with delimiter "\n"
+ T3 z( |% S1 M6 H: }        set load type to A_tote0 E+ R4 I: u$ ^: ?  |
        if A_tote="tote 1" then set A_induct to 1# ?5 T7 I9 h6 T9 [
        else if A_tote="tote 2" then set A_induct to 2
0 Q+ A# Q$ g. m; O. l  D$ C2 D            else set A_induct to 3   
, @/ k0 K, f8 u  t& o        set A_i to 0' R* C; d8 }1 s4 S1 {
        clone 1 load to P_induction
9 |7 i6 `) e" \! U        wait for A_time sec1 C. G6 ^" j; }
    end0 y4 Y; O5 R# D' J; |! S
end: a8 V1 e' x9 v- z* Q2 c
$ Y7 A, |( _! d( {* j
begin P_induction arriving
, h, f/ k: u* V% C: q$ X8 S    if A_induct=1 then clone 1 load to P_pick1! P9 [+ s+ O  P" i+ E# _
    else if A_induct=2 then clone 1 load to P_pick2: k1 t/ K( {. h# u
        else clone 1 load to P_pick3
1 Z6 K: f3 M4 c; eend
* A4 O8 s6 e9 q( @# b$ x# E
; O8 x( }5 q4 C) ~5 Mbegin P_pick1 arriving
; n* ^) o0 g7 [6 d# a4 V3 r8 E$ E  ]    set A_i to 1
% `8 X" W/ T; K' T- k    move into Q_induct1# Q+ z9 K; b' D# h3 [5 G6 m
    move into pickaisle.induct1! w5 R! Q3 W7 {+ [' U) D- o
    while A_i<=30 do begin
; X  W. k# w, ?5 u; e        travel to pickaisle.con(A_i)3 V* Q9 A0 P8 z! N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. P+ E2 u: p; y* j5 X9 k5 ]% Z! u  @
        else wait for 10 sec' q) H- O2 H6 x! B3 X
        if A_i=A_leave then send to die
1 v- x* v# K) b0 X3 C, h: W        else inc A_i by 1, P  T: }9 A6 U7 w; O
    end
, t- e1 H" D; Z. }* Nend' J% a0 c! ]5 g- a! e. Z
+ u' {/ w% s* L# X
begin P_pick2 arriving
8 G1 c3 a+ t/ h$ F& k    set A_i to 11; v# p/ N8 b* [# G5 P- E( `1 w
    move into Q_induct29 w5 \& y8 K8 o9 x4 s9 }9 p% B
    move into pickaisle.induct2
7 g8 E; c" K& |9 f6 H    while A_i<=30 do begin# L" b( E" l/ W3 h
        travel to pickaisle.con(A_i)) E7 Q4 P0 s1 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, v* u0 G3 K7 g6 E  t* @0 b        else wait for 10 sec" W, w6 p; x* z& n# I* L
        if A_i=A_leave then send to die' c4 h) L. @  s( U1 D% m
        else inc A_i by 1* B! d4 M$ {( g8 X. t+ H0 D
    end
' x1 h+ o" z- v) B. V( x1 f, L+ n: Mend
3 K- w1 t, y$ T+ N2 @* f0 ~4 H  }& @/ e0 Q# Z3 }: t! A0 J4 E
begin P_pick3 arriving, W  x" Y0 a* M/ q
    set A_i to 21  r* y7 C2 O, B& Z4 I1 e
    move into Q_induct38 _4 ?& P! @- x$ t4 N  L  `
    move into pickaisle.induct3. J* U( s6 |, }
    while A_i<=30 do begin
8 R7 K" S& |5 T" E  p4 S+ V        travel to pickaisle.con(A_i)
5 O0 S: s: `& K4 a9 c5 U- a  L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Y' Q" ]" {9 O
        else wait for 10 sec
5 z- ~4 T1 a4 E        if A_i=A_leave then send to die' t8 F1 O- A; }3 H
        else inc A_i by 1
' u3 b. E! p6 Q' f( X    end  z) `" L- r% 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是个什么东东?
1 [2 V* o% ~" H5 s, k7 f% ~9 gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
# w' n5 K. S# M1 a( n5 L$ |$ \2 y$ E7 C1 |
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) x: _% O! i4 l& L

! g( H. H& r/ p& }; L" l; V6 }另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- u: x, B. W, n6 \4 h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% W3 F' d3 k( K3 ^: i# m+ I
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 D9 [" `2 I8 \- }# t+ N, A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 q) I, S! u# j
begin P_induction arriving
( S0 a0 F- x+ r" r7 l    clone 1 load to P_pick(A_induct)
$ p* P+ G) H& Send最大的系
( A; X. V8 I2 w# f* l' M# r8 f( P' p7 h* {; l7 M- ~
begin P_pick arriving
" Q6 P5 F+ E* `    set A_i to procindex * 10 + 1
7 r: l1 T3 A; }  f. p( R% Z7 j/ u& Y    move into Q_induct(procindex)
; f% a) z/ |) ?; L    move into pickaisle.induct(procindex)& S4 C- d5 W' d8 a0 Y
    /*check the type of pickaisle.induct(i), for your last problem.*/# h+ X+ Y6 ?9 x" _

9 {6 w( C. w' t9 x& {" U    while A_i<=30 do begin- C- O# X* m0 x  k7 a. t& P
        travel to pickaisle.con(A_i)/ e" x7 l9 M. U; q$ z0 t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 r8 l- S* S! A0 ?1 b& J: ?
        else wait for 10 sec9 `: S' i  X$ ~% |1 ^$ o- `2 _. x
        if A_i=A_leave then send to die
' I" i2 [# {! T& j- C- n        else inc A_i by 1
$ l9 W9 T. j) L) S% a    end
; A; z; r2 x! X% Oend- X& D4 `9 k, Y  k

4 a+ g" F: J4 x/ q其中的procindex为整形,代表当前process的序号。) }+ h, b- @2 n# v5 a# p0 y( R) n
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, 2025-12-5 10:34 , Processed in 0.017882 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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