设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13205|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 G+ u2 r  C" c9 L; _# N
0 C+ j. Z: u" z% V+ 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中的数值,不知道会不会有什么不妥。
) _1 K- I% L7 G7 E4 G+ |5 D5 f* Q7 M5 Z0 z6 T' R
begin P_read arriving
- L1 E  G: D+ m8 P* t: @# W$ c    while 1=1 do begin
# _" P3 v# k7 K        read A_tote from "data.txt" with delimiter "\n"( Q7 j' V$ ^- b7 Y
        read A_time from "data.txt" with delimiter "\n"' `4 B' Q2 [% ^  M7 }
        read A_leave from "data.txt" with delimiter "\n"
" w) y" l/ B4 J1 S8 Q& n        read A_picks from "data.txt" with delimiter "\n"
  z0 S$ N: [* a; ~, c        set load type to A_tote8 J8 G9 x! S7 {* _0 c! \
        if A_tote="tote 1" then set A_induct to 1! r- F2 Y. G, v) O3 J
        else if A_tote="tote 2" then set A_induct to 2  Y, X9 d, N/ _( ]
            else set A_induct to 3    + [8 W3 U- I3 N! O( k2 n" a
        set A_i to 0' ]" S! m0 Z4 v7 u+ s: j0 y
        clone 1 load to P_induction
0 M4 L" D2 B" d+ N+ _        wait for A_time sec
" [& d! _+ E( F" N    end
2 R' \2 w) `3 K+ gend
" K+ {. d" O7 i) e4 F1 d- T; v" c9 L2 W8 G( n
begin P_induction arriving* W% I3 l9 p! ~: n) D8 d
    if A_induct=1 then clone 1 load to P_pick1
4 T  ?# b) m( L: @. c3 g2 o, ?2 |    else if A_induct=2 then clone 1 load to P_pick2
. \% m, F9 R! r$ D$ _6 C! ~        else clone 1 load to P_pick3
3 t' b) Y) s! q, i4 Z7 send
% O9 S: F$ ~8 n9 o0 b; T0 z: I7 }% d8 |% Z
begin P_pick1 arriving
! L+ l: T# D4 N    set A_i to 18 ~% Q: [4 T/ e, k' \
    move into Q_induct1* z1 z; R" T) t* A
    move into pickaisle.induct1- A. _1 r9 }# A. _
    while A_i<=30 do begin
+ @4 P* N- E% l' C3 }  E: k! T        travel to pickaisle.con(A_i)
/ M0 z5 q3 `8 p& T2 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, b3 U  z5 S+ m( E
        else wait for 10 sec
( w$ i4 z2 r' R9 I        if A_i=A_leave then send to die3 [5 j! J# @4 b: S9 E* b; c3 z
        else inc A_i by 1! |  m# `8 |7 f' i$ r: Y( g; @
    end1 T! z6 e8 M. K+ c% n$ |+ I$ V8 A
end0 ~: Y4 c, U3 D7 S7 H+ |2 q3 j. b8 K

0 q$ V1 @4 r" }begin P_pick2 arriving: e" o. S1 A3 {+ @1 b& U
    set A_i to 11
: U8 R0 Y0 {9 z) }$ e" b, V# F    move into Q_induct2
$ v5 _* ^/ h% N" j% A# y    move into pickaisle.induct2
/ N) f/ R/ N, d1 L5 O4 C4 {* A& m    while A_i<=30 do begin
8 X) F4 s5 X$ T. X4 Z+ Y        travel to pickaisle.con(A_i): }; v8 F, g4 _0 E2 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 q9 S( P9 P! J: ?) R
        else wait for 10 sec! v- E6 d9 j: B0 V: ?
        if A_i=A_leave then send to die. o) m7 t* W1 H0 V
        else inc A_i by 1( t( ~. w# |1 E' P6 j
    end
7 x; u- G6 E# |; V- v# ?end" y3 G2 a4 K" L3 w

) _8 @! t  A4 k7 B% S( Fbegin P_pick3 arriving
1 |; u2 }5 z! p# }$ j    set A_i to 218 N/ V' t% y  l, k: S, ~. \
    move into Q_induct37 M& {+ D+ U/ `+ V" B6 ^9 N
    move into pickaisle.induct3
& r+ S4 O9 c7 }8 ~& m# ?    while A_i<=30 do begin6 q  i. v7 G; `2 Z
        travel to pickaisle.con(A_i)5 H$ ]9 Q& R' J+ y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ K7 \' s/ I& B5 i  F9 c$ S' s
        else wait for 10 sec
0 t% Z6 d/ M+ q        if A_i=A_leave then send to die
: |+ e2 m+ |8 n/ i$ D: B$ ^3 A9 w; k        else inc A_i by 1" A" _- ~$ S6 f) i' k
    end( r$ ~# K3 [2 w7 Y, q) ?% ^
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是个什么东东?& e/ z/ I$ c( S0 C0 W2 M  z! T, o
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* t- a2 F; Y. ]- B9 r: F
. p- P4 z  p! l* d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# t; [$ [. m) ]% X) Q4 j' x9 r! ~2 u+ j4 x. Z
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ c! _' L, c/ n% b& _( G
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 Q1 G( Z$ b% K8 o) p/ B/ ^2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;- K3 `) g% S0 t( R, X
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
0 ]: v' h$ ^0 r. Qbegin P_induction arriving3 T) F) w) G# o: ]4 U
    clone 1 load to P_pick(A_induct): \0 g5 U$ o" k/ C- w; P9 g
end最大的系
% l. F, n8 }5 S7 ^$ B
( _1 f) D% K: M% k! obegin P_pick arriving2 q% N  S" d4 f) m
    set A_i to procindex * 10 + 1$ M$ F2 {. \& H/ b/ [6 j
    move into Q_induct(procindex)
  Z0 A, ]% `7 T4 O) ~    move into pickaisle.induct(procindex)& m6 F5 ]6 {, h( Q4 p& n# R, T' m
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 A7 l2 _2 V2 I: t' f" u* ]0 @( p9 L/ Q! K
    while A_i<=30 do begin
$ ^4 P# S4 Y. S  f5 q, f; q        travel to pickaisle.con(A_i)
* }8 @' t' Z! U. v: V, D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ s3 N. {( h5 \' \4 c1 s& U
        else wait for 10 sec
+ y/ {3 g: n3 {; s        if A_i=A_leave then send to die6 s( Z. O) G1 w$ X3 v8 X9 H' t
        else inc A_i by 1
: W5 c. \, L. `! m2 m; `8 D    end
) U" h8 e+ B. H: H( ]/ c, j! s: iend. V) N4 }2 M. f

/ |0 \, {' D7 V' U其中的procindex为整形,代表当前process的序号。
" H5 f: Z& i# }+ s5 N0 |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-3-26 20:38 , Processed in 0.018144 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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