设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9720|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% H7 k5 R2 `$ ?; r8 C
% N5 Y# h5 I5 w& u, p* Y我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* ^- F# V0 L' ^0 A. n2 L$ @" b/ N: F0 u9 D
begin P_read arriving
9 h9 c$ F4 }% R& a( y6 q    while 1=1 do begin
" R0 N: M6 a* U5 C8 R) R        read A_tote from "data.txt" with delimiter "\n"9 h6 I  H3 Y& |8 k8 G
        read A_time from "data.txt" with delimiter "\n"
6 l1 |9 c' u2 J4 c/ _  y        read A_leave from "data.txt" with delimiter "\n") ?8 F) S! s4 ]1 K6 A
        read A_picks from "data.txt" with delimiter "\n"
" Y' `! n4 A0 g9 z  F        set load type to A_tote1 u- i5 f. ~) A- y* q! d
        if A_tote="tote 1" then set A_induct to 1
# T8 B: m/ P5 h5 v( c        else if A_tote="tote 2" then set A_induct to 22 n* Q6 P% x9 ?
            else set A_induct to 3   
8 }+ Z( ?5 [5 q9 d$ |/ T        set A_i to 0+ e4 _) z+ M# b) y  _
        clone 1 load to P_induction
/ V8 _9 [0 ^- {. ]' X$ V        wait for A_time sec
% T: e% I/ \; S, U$ @0 \    end
1 R4 z+ ~* o3 t) z5 `9 ]  J  z' Wend
0 l$ L* J3 I. x; l$ i/ f! v
0 i+ Q' ]! o  n3 obegin P_induction arriving
- }+ ?9 m- T" N    if A_induct=1 then clone 1 load to P_pick1/ z- C$ D/ w1 x# p, i7 y
    else if A_induct=2 then clone 1 load to P_pick2
9 f# q( q$ i2 x. q        else clone 1 load to P_pick3' H$ l" j" o9 n0 R7 i
end  m) M/ V# v: t8 ~% O+ C
8 S# b; L2 N1 d) n4 h$ b' f
begin P_pick1 arriving
9 X, D' a' q1 h$ b, s9 E    set A_i to 1
  s3 K. ^8 \9 [    move into Q_induct1
$ m* t$ ]* V& r+ |# z- M/ ^    move into pickaisle.induct1
% a. V5 X. Q* ]% Z/ \/ o2 Z5 M    while A_i<=30 do begin5 n# [+ v2 j4 i9 T$ E, n7 S
        travel to pickaisle.con(A_i)5 s6 [( l: \9 e3 x1 \5 n9 S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 B: X! @( G* y& ^% ~- j) T        else wait for 10 sec+ ^. y% i7 H2 ]
        if A_i=A_leave then send to die
/ L4 `) M; W; H2 u        else inc A_i by 1
: p- {! H; f- O2 C5 E# u3 j* t) _    end) v4 X3 |$ m5 ]
end+ r3 E2 i* Q' }
3 \0 U4 {; _* |6 Z( ~
begin P_pick2 arriving
+ F. Q- e* ?& ]/ i3 v  [    set A_i to 116 E! a4 u; S+ s0 y: S7 I
    move into Q_induct2
9 D- S( q9 ~! D; i9 m" I    move into pickaisle.induct2  @; q+ F! O) K* b9 f* r
    while A_i<=30 do begin! e* V5 M' @/ `" z
        travel to pickaisle.con(A_i)0 @* a  n9 V! I5 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 [# i, t5 W" y
        else wait for 10 sec4 q8 C. V& g" G; K! Z' t* n$ ~
        if A_i=A_leave then send to die* x; V1 y9 j  U1 n5 K4 Z0 o
        else inc A_i by 1
- i2 |& e7 c6 Y/ x    end
) ^" m) V9 f0 U, Z2 S, Send5 f) h) }: Z( d: x- N/ l  U

: w7 L5 Y8 K' [2 w. Z4 D6 |- gbegin P_pick3 arriving
+ @: J" s# k6 h4 z- Z! I    set A_i to 21
' `) b/ y1 ?* l$ ?" P& J    move into Q_induct3, q3 Q. i3 c& l
    move into pickaisle.induct3
0 |$ h" U' ~9 S    while A_i<=30 do begin
5 l9 j" r9 v; Z  b6 T        travel to pickaisle.con(A_i)7 ]1 o- m' U" `0 k' B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 j1 ~! b% c* U; i' A
        else wait for 10 sec& `1 m1 y) }) y+ ]7 `% k5 u
        if A_i=A_leave then send to die$ S! v8 P% I. `
        else inc A_i by 1
6 ?* z  `; ?$ Q* h" v    end
$ H! ~  y7 O% r1 oend

最佳答案

查看完整内容

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是个什么东东?, F' h' {  z: v" }
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?+ C6 l' @$ U2 W1 e& x2 v6 i7 \
! n, A" G& i# f, S2 M! ]4 [
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 y" c; }8 m/ b# M" A1 ~. o

/ [2 H4 L' Y8 M1 I7 G1 d% p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:# U3 Z/ @. n) D4 v3 k% B( A' s- r
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% V- k( j( z- S. V5 O! r9 {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  ?+ @; o, ~1 n. c
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 u' J+ V# p4 k& ?begin P_induction arriving5 U6 _$ K7 T* G9 |# R6 C
    clone 1 load to P_pick(A_induct)3 p/ [, k9 P6 {' u% [( y4 z+ N+ V
end最大的系- m4 s$ B. ]; ]" `  y7 f

, M  N( [0 p3 h, Y5 ?begin P_pick arriving
1 v3 n: v- U* ~1 n- e    set A_i to procindex * 10 + 1
  j# w, o3 p+ D# f. v. ]( h    move into Q_induct(procindex)/ \: M* G: s+ w, f. |6 g, q# H
    move into pickaisle.induct(procindex)
, C4 o4 d: B/ J; f* Q$ ?    /*check the type of pickaisle.induct(i), for your last problem.*/  s/ p8 A$ i8 v
* a3 S; H' Q  l# I7 e
    while A_i<=30 do begin; H! F; R& e9 F* \" I, z  o
        travel to pickaisle.con(A_i)
( j1 g4 Y/ E. W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 F* x3 W0 [1 T( F- n        else wait for 10 sec
7 T9 y# b/ Q$ x- c        if A_i=A_leave then send to die
- W7 b3 [, z  O        else inc A_i by 1
" t6 U1 O/ T! [8 D    end6 T" g: O  B$ x4 }. ?' B
end
# @4 i0 E9 W, F& A
  O1 t8 b9 B9 o  k其中的procindex为整形,代表当前process的序号。
- a& ^7 J% ?2 `4 a6 |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-6-26 21:18 , Processed in 0.013894 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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