设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13844|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 ~, M+ O! X. Z5 A- {2 K: S
4 l' U# h% I. f2 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 p( s3 A" B# C& t  j! J
: m7 N' p8 F& k0 ]& D
begin P_read arriving+ t- F. s2 X) L8 T' N3 e$ S, A8 A* m9 |2 z
    while 1=1 do begin
# E0 y* u8 A7 N3 C        read A_tote from "data.txt" with delimiter "\n"
* L2 _; R9 s! E        read A_time from "data.txt" with delimiter "\n"7 u/ m2 ^) g. T
        read A_leave from "data.txt" with delimiter "\n"
! T7 [8 G* C0 G: E/ z) A+ b        read A_picks from "data.txt" with delimiter "\n"
% d+ ^1 B8 D; ]$ R% B5 w% |2 j9 ^        set load type to A_tote7 \7 K9 ~3 O. J3 ~
        if A_tote="tote 1" then set A_induct to 1
3 @6 p" M3 D8 G2 X, Y* {1 ?5 M        else if A_tote="tote 2" then set A_induct to 2
) I% k& `! P! J# Y- `6 @8 m; G9 @            else set A_induct to 3   
$ W" Y/ D& c) L+ x* T0 ~        set A_i to 0
, q3 g! g5 W+ l# a        clone 1 load to P_induction
0 k  s7 o4 Q0 p! l% D. `        wait for A_time sec# c3 |4 C0 P5 Y3 u
    end3 d1 ?' Y. b+ p5 ]
end
7 s0 b. ?' v& f4 ]) [. d) H
( J% {+ F/ a8 Fbegin P_induction arriving
) R( ]4 }4 O! V7 B    if A_induct=1 then clone 1 load to P_pick12 ^* o9 ]1 A( C
    else if A_induct=2 then clone 1 load to P_pick2
3 F% U. R2 q1 _+ e& a% X        else clone 1 load to P_pick3+ d: K9 H! e0 e4 R6 ~& m* _
end$ G; |5 G6 ^7 k, z  g# K

5 W. x  ?6 S/ _. C) ~9 ^begin P_pick1 arriving
1 j3 s5 N, O  z7 D' A. K) N4 E    set A_i to 1
' a; J; M) w# F1 s+ @7 D    move into Q_induct1* z- V2 I; A: Z! L4 ^1 D2 M7 p
    move into pickaisle.induct1. s; j( I; C* o8 e
    while A_i<=30 do begin
# ]( z0 {& s) @/ B        travel to pickaisle.con(A_i)0 W& y8 i% x+ m. Z  ]: Q  K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: y. R1 E% r8 C' |        else wait for 10 sec6 v: e& a  p5 Z* Z1 f4 P, k
        if A_i=A_leave then send to die1 f$ ^8 ?; ]2 d
        else inc A_i by 1
6 c4 s' m! [, O5 [; g3 I# e    end  D( k* U- ^- V* }6 y
end) X" Q/ C: M9 J; m2 N" h
/ C! `& H! y2 p# }
begin P_pick2 arriving  ?" k# u: z3 F; j  D( k
    set A_i to 11! K3 p) Q" Z* Y1 E( @* Q
    move into Q_induct25 ?# a+ F: [) f  h. f8 {- F- y
    move into pickaisle.induct21 I* ~: `8 l1 O* _* I8 g
    while A_i<=30 do begin
7 T+ G! {& {2 D: N1 |        travel to pickaisle.con(A_i)
1 V& N! ^1 H% \9 j/ Z: }6 T+ L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 Q( Q. m9 c. S
        else wait for 10 sec
# g% [" N4 ?5 k" t4 C2 f$ h        if A_i=A_leave then send to die( P6 Z; K8 B) t6 J" b
        else inc A_i by 1
0 v' ?7 o/ w' [! H4 D. [5 `5 ~    end, t% x4 b6 `8 @
end" w' e% N2 n$ V' H; k2 I3 W
( f5 `4 N. @- n: z6 g0 W
begin P_pick3 arriving
$ M% C6 A$ K5 O/ K/ Y% z+ {) w    set A_i to 21' G. c3 }$ j* M6 l: i2 O
    move into Q_induct3
' A" ~* z# ~- Y    move into pickaisle.induct3  u" z" D( S3 K# d6 }. o1 n, ~! p; R
    while A_i<=30 do begin
9 j+ r; C9 z; [2 ]% t( S) F        travel to pickaisle.con(A_i): H5 P; s# w. s- T  x) |7 i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* W; {/ }6 Q' C# S
        else wait for 10 sec+ Y" W0 b- c  _3 y
        if A_i=A_leave then send to die& [1 A+ s  h3 `1 b* e3 m) V
        else inc A_i by 1  {7 j! U. Y* M7 M/ ?3 B
    end
3 e/ j5 Y  B! d/ zend

最佳答案

查看完整内容

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是个什么东东?9 X" \7 }8 q& n
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 e2 t/ M& c+ l5 v3 {! K

' j5 `. h9 U0 A6 j2 W! F$ OAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 Z1 P1 e6 Y# i* Q& x" V- ?7 `+ K' g9 g6 ?$ m
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 q1 m& m3 G  X; [0 U6 m8 q* P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ v/ M4 K2 T# t5 U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' U" y. F6 K8 R% q% h. [; h) V
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
' I" }! R4 t( f, _2 I; w6 ~begin P_induction arriving5 Q1 Q% B9 Q8 X5 H( B% H
    clone 1 load to P_pick(A_induct)
. _- Z+ S; x6 A$ K) Tend最大的系% m/ c+ ^  [) s( z8 Y4 N

- B$ C% h+ ^, f! I/ `begin P_pick arriving
7 h4 O% D5 e1 a7 f    set A_i to procindex * 10 + 1
- j* n, ^9 R4 ^( U9 Q% N& {, M( y/ w    move into Q_induct(procindex)5 l% t; |. x3 u0 J
    move into pickaisle.induct(procindex); J* N# t6 t& K
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 _; ]. U$ \) c4 D
2 L% I' j+ K/ k. g, L    while A_i<=30 do begin/ {! i# }" A$ F1 w4 J- r
        travel to pickaisle.con(A_i)7 [2 A1 F5 l$ [$ H/ ?- s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- V; X8 ^+ C/ M9 a        else wait for 10 sec
0 u; J5 j7 K8 L. O' D        if A_i=A_leave then send to die
' a4 f3 o7 a' x        else inc A_i by 1
) a8 \( C" n, R    end
$ B+ g+ R* t, X" o/ B& eend! P" I* M) e* W

: `' X2 y# }' H1 }- j* k其中的procindex为整形,代表当前process的序号。8 |7 \2 R5 ^7 v8 ]% J0 h5 v2 b
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-12 05:35 , Processed in 0.020245 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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