设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13883|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ C% r) }: s/ t9 T
$ a7 G, r* l( |0 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) w; w$ t, z: A' K
6 f( ]# l5 a0 R2 L7 n; j
begin P_read arriving* h3 J( J. P! t( {; C. D
    while 1=1 do begin
! t6 l" {! z' j+ Z# H        read A_tote from "data.txt" with delimiter "\n"
1 t+ m* O; c4 P" y2 _        read A_time from "data.txt" with delimiter "\n"
: {( R3 ^  k6 B+ n1 B- k8 ]        read A_leave from "data.txt" with delimiter "\n"3 f4 q( y9 A2 X
        read A_picks from "data.txt" with delimiter "\n"/ f% X, U" h1 U7 e7 G
        set load type to A_tote2 X, g) E9 ?) j: G
        if A_tote="tote 1" then set A_induct to 1
/ u- D- C% }) u8 N5 x( M! Z        else if A_tote="tote 2" then set A_induct to 2  p9 H  _3 ~* W. i) x) L) z
            else set A_induct to 3   
4 l* b! {- M- C% u        set A_i to 0( F, O7 {3 f! N& e& i
        clone 1 load to P_induction
; `6 q; T; V" \9 z9 j" D3 A1 e        wait for A_time sec
; s* G0 Q& O& p2 W    end
( P8 w8 {& m7 L2 \2 ]' eend
4 q& ^$ N3 R" x+ P9 _, n, e( Z1 V' \- y' ?0 d, b5 T; U$ A: y) Y* k  c
begin P_induction arriving
& ~8 r8 F. R/ q# o9 Y" {    if A_induct=1 then clone 1 load to P_pick1
, J! N- D6 ^9 M: K    else if A_induct=2 then clone 1 load to P_pick2
* O( \$ t3 O  D3 P1 s        else clone 1 load to P_pick37 i& x$ f( I- Y( T3 m
end& u9 d: x3 l' `" T; Q4 q
2 s6 S' r- s( a5 S' r- y" R( h
begin P_pick1 arriving
+ \& Y5 \, s7 t0 |& X    set A_i to 18 G& z, X, _$ J
    move into Q_induct1
( P6 }  G) h" O: K9 l    move into pickaisle.induct1; V% Q$ d, \" L' Y% e
    while A_i<=30 do begin; C  F7 n$ a  l/ w
        travel to pickaisle.con(A_i)
. V7 j% }/ {2 g! ~, p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! f3 Y( p& W; `# C/ ~- F4 A. |        else wait for 10 sec% t, ~" U1 z# E) Q
        if A_i=A_leave then send to die
4 ^+ j) H* Z% I9 @% G7 Z3 W        else inc A_i by 1
3 z  \) Z) p. n% `& S, `0 S    end. l% `7 A. L/ v- ~: J
end
( L0 Q4 F# n6 W+ y. x+ U0 ~. U/ Z0 I& X9 V
begin P_pick2 arriving
. Q, F# g  d& h( g$ e    set A_i to 11$ K& ~- x. [5 K3 D* Z4 n  |- h# J
    move into Q_induct2
% f: m6 e$ C$ _    move into pickaisle.induct2
- u5 a+ L1 w, y, e/ {9 d    while A_i<=30 do begin
: x  {2 G$ y4 O1 ?% \% K        travel to pickaisle.con(A_i)
8 f2 N6 K0 S- h8 ^! `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, }: k& S1 C$ O$ H
        else wait for 10 sec
- l4 A' G: C& W5 J' M        if A_i=A_leave then send to die
! P1 P/ c+ {' B7 i        else inc A_i by 1
9 D( t; O- v* k9 v7 T8 ^7 i    end
2 @" r* {7 v9 gend, z6 |, T% e1 [# k: w9 c2 P
% P& `$ e( {& O8 L. h$ }
begin P_pick3 arriving: V" T$ L% u' {
    set A_i to 21
! P' h' w; ^6 r0 a( n3 K    move into Q_induct3  W  G. _+ F! D# ?# A! t( C
    move into pickaisle.induct3
" m& Z, P" e. }5 Q+ l5 Q- t    while A_i<=30 do begin- C0 o- m( V" q9 v$ o& m5 l
        travel to pickaisle.con(A_i)" d- n/ P. }3 x1 e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: Q' M; i+ j9 A2 k1 ?        else wait for 10 sec
6 A: s. |. ?( @0 S, V/ U2 z        if A_i=A_leave then send to die
. k% R( m% w3 D* }        else inc A_i by 1; R. H2 m3 q! R: w. a% g
    end& a3 n' l6 J  v5 L
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% a" h& n  M$ [' x) Q  c
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 c( s: g+ F# P5 }, \
% l0 c2 w9 B4 L9 w
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。& j8 V3 l* u3 @1 s- Y7 U

; o6 t* u( ^! D& E! k( n( a; d$ e另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% \7 e  ]; ^7 W0 V' A
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' V+ i% z( K/ ]7 [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& Y1 U+ g' a1 i" H/ G& ~5 y. i& w
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 A6 d  ?) ?; a; }2 e, n" Q
begin P_induction arriving+ d( z( n) a% A8 k5 q0 [1 A
    clone 1 load to P_pick(A_induct)/ H; F8 L4 x. |5 A8 Q
end最大的系
' e/ [' e5 k% O. v3 m( @* |! ]* l( M
begin P_pick arriving6 ^, ?8 ?; c5 O3 G4 X" P+ l$ R
    set A_i to procindex * 10 + 1; Y0 x/ @( |: q8 U# {
    move into Q_induct(procindex)( h3 _; [1 {4 j$ E/ J3 I2 ]
    move into pickaisle.induct(procindex)
; z9 U: K9 b4 b5 C0 J) U    /*check the type of pickaisle.induct(i), for your last problem.*/  H' A2 C) H) X4 f  m

; i6 ?# l- k5 D. ?$ _5 \% @; |    while A_i<=30 do begin
4 O; x7 Y# \' P        travel to pickaisle.con(A_i)
) S* b7 _, Z9 o% J3 d4 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% H3 K" E! u: z: ~0 O8 X  n        else wait for 10 sec+ m  v: C# p" x5 ?9 r
        if A_i=A_leave then send to die( I: c" n9 c' q  ?  z/ l. D
        else inc A_i by 13 F2 L5 a& p, z! l
    end
1 \- W: V0 S6 q3 Aend
1 T: {# D3 A4 I4 k5 p: e7 ~, O, J$ N
其中的procindex为整形,代表当前process的序号。- q- |- C( H" N: 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-5-14 10:08 , Processed in 0.015722 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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