设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11632|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 n0 W7 g7 J4 g, R. u7 f# V, X5 z" w

& Z+ O: B/ s; n. d4 f我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 y% g4 E) `, D& a; [

1 m* r0 z: r. ?begin P_read arriving
" v( F9 \/ z, b' @' `0 T    while 1=1 do begin
) o$ h  [/ P& U/ D        read A_tote from "data.txt" with delimiter "\n"# I" _' e' r4 r# d  g
        read A_time from "data.txt" with delimiter "\n"# u5 f0 h# `2 J% T, v! `  f9 ]
        read A_leave from "data.txt" with delimiter "\n"  A0 {1 Y) v0 [4 \
        read A_picks from "data.txt" with delimiter "\n"
8 f, k8 B1 G& [/ J        set load type to A_tote
/ s( w* ^" a3 H& y1 l( {$ v        if A_tote="tote 1" then set A_induct to 17 |+ e" {, L! ^
        else if A_tote="tote 2" then set A_induct to 2
/ I1 T& E/ f8 T' k4 X& J# n            else set A_induct to 3   
! O% \+ p( ^" t$ o2 b        set A_i to 0* H5 j/ l/ e0 k8 x
        clone 1 load to P_induction2 ]& v6 Q/ \" p' ^/ L
        wait for A_time sec
* e* u' u5 s2 {  K7 @    end7 ^7 V8 ~5 x# w; `- H
end
: Q5 x) X2 V9 o; r8 }* v, ~0 H# i9 d( {% @/ |
begin P_induction arriving
- Q. d. q$ s" c( D; c6 n    if A_induct=1 then clone 1 load to P_pick1, m  O/ x% W: @  ^
    else if A_induct=2 then clone 1 load to P_pick23 z7 O- i- G2 c5 n( r
        else clone 1 load to P_pick34 \7 U! ]; k. X) y* b+ i
end
9 j' C; W0 i/ v$ [$ r  N# V/ S9 W9 A: [1 Y
begin P_pick1 arriving( B5 d. M, R! x$ [! r9 ~
    set A_i to 1
+ h; i5 L( c0 z8 H5 J% Y    move into Q_induct1% i- n" L* @* h2 N/ X- f- A* h& w) h
    move into pickaisle.induct1
' h" ~5 x6 |/ L0 z) T    while A_i<=30 do begin) L' g! E5 f% C. x2 J# c- D. u8 Y
        travel to pickaisle.con(A_i)
# ~: h5 _0 J/ c; H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* W; A: z% e& p! `5 l, Q
        else wait for 10 sec
3 A7 j1 e# s" c4 ?0 r7 u0 S        if A_i=A_leave then send to die
( |, M5 A0 m- m; o0 C+ g        else inc A_i by 14 c+ {) `$ x* V! }3 D2 o
    end4 P! Z9 Y& A  y3 [5 Y
end
3 E. S, o+ X* g1 [9 H3 g; E0 c. h5 b
begin P_pick2 arriving: T$ F# {: h- }1 k% w3 [
    set A_i to 11
9 h' G7 f9 r5 i    move into Q_induct2
! P; V* i6 q: y0 {7 L! l7 c    move into pickaisle.induct2
7 G& T5 B& E1 J9 v8 N    while A_i<=30 do begin- v" Z# O* |  Y: q9 U
        travel to pickaisle.con(A_i)0 I+ f3 J6 C+ F: N/ t1 M+ t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 o1 H" C5 b% \6 y
        else wait for 10 sec
  c* }# V7 [  x& k) f$ s        if A_i=A_leave then send to die
  [- K+ k# U. M  N8 h        else inc A_i by 1' _  L1 d. {" ?6 z
    end+ s! r- u' v  V- q# D
end
0 S8 s! ~" N, O2 K- q. f
0 ]- [5 Z" r* y0 Rbegin P_pick3 arriving
% D0 O) d! \+ w/ M9 x$ s! Y& d    set A_i to 21
$ ^  Z7 F1 i, h& y; Z' l/ h    move into Q_induct36 f2 G1 F* p! B  a# r; `# t$ t
    move into pickaisle.induct3
3 e5 ~% Q- K1 l+ j% m3 c9 c6 E/ Q) ?    while A_i<=30 do begin
, j) O0 }6 o4 v1 c4 Q# B8 `$ H# W        travel to pickaisle.con(A_i)5 ^. j' q; n0 q9 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) h" T0 X( U) \+ }4 h. X. m+ [7 H3 w        else wait for 10 sec9 e  c9 N% p. N" v5 b, A+ Q4 B4 O3 z
        if A_i=A_leave then send to die- ]! B7 E  X2 P4 `$ }& t3 Q. B
        else inc A_i by 1
7 [, }! w1 u; `* k% E. t/ r+ J% i4 ~    end
( v  O" b# w  f. ^) f# 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是个什么东东?. r% M0 J! e1 A4 ]
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 L& ]6 k# o! T# q( D
1 ]$ M$ s! I3 i
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 t" R8 k1 F8 I6 C

$ v3 C8 q$ H0 A& E# S' Q7 k; |另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ K* C) ?3 |+ t! @$ r: x
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
1 e' {9 Z* c. Z& k, N$ D! ^2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
  ?6 x0 G" a" b3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 P8 v( j6 _/ l+ M& _4 r& W3 Y4 b
begin P_induction arriving4 u0 }2 b5 w7 f4 \; r! _
    clone 1 load to P_pick(A_induct)4 Y( K! ?" s: y3 C$ i
end最大的系% f6 k, C/ F% e5 K' ~$ l
  X+ b  Z. j. A1 n' Z. \
begin P_pick arriving
$ J7 e9 O* Y. |( v' I: v    set A_i to procindex * 10 + 1
# x1 c* Y* [. D% Q, E    move into Q_induct(procindex)
- ^( E) L4 f1 r4 {    move into pickaisle.induct(procindex)
& X* }, y/ J# s# }' u    /*check the type of pickaisle.induct(i), for your last problem.*/
2 b4 j6 C4 t8 A% `5 J- q& f( g6 F8 C" l/ a# l
    while A_i<=30 do begin1 I, `5 l2 k! J$ @; w; v) s
        travel to pickaisle.con(A_i)8 l0 w6 y+ H3 F% b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 f' P6 {$ j4 o* {! @. R
        else wait for 10 sec
; T& A6 c' I/ E2 V        if A_i=A_leave then send to die
" z  U( L2 P6 S8 ?/ L, p" \        else inc A_i by 1! A9 o. g& ~3 }, D
    end& A- g/ Y; w9 K* ^# p& L
end
6 t7 _0 Q2 n8 U8 _& j. k8 K1 G" P7 Z
其中的procindex为整形,代表当前process的序号。
: ?- Z2 L# V9 r+ i0 ~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-11-24 21:30 , Processed in 0.014877 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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