设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11584|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 G6 U, i& \, q/ b
$ E2 Q! n! J  Y  Z5 h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。* y, l8 K; p" H& n9 M

6 Y) }' h% {& K8 t) V: Kbegin P_read arriving
& j% ^& u! F7 J6 r    while 1=1 do begin9 c. h1 h0 ?, P6 q6 t3 C
        read A_tote from "data.txt" with delimiter "\n"8 Q5 d, k' W8 q6 e; }2 D7 Z
        read A_time from "data.txt" with delimiter "\n"
% x# m7 f, E  V* W9 w, O        read A_leave from "data.txt" with delimiter "\n"
$ u) p, \# x# E5 }        read A_picks from "data.txt" with delimiter "\n"  m2 D" k6 D) L6 ?: i6 _
        set load type to A_tote
) A& _! L% a  {- U' |- W        if A_tote="tote 1" then set A_induct to 1
1 m3 X( r+ f# v: ~- x        else if A_tote="tote 2" then set A_induct to 2
% @+ {) }8 ?0 U2 V            else set A_induct to 3    # r7 H7 d6 M! r1 Y4 ?) G. F
        set A_i to 07 i; |& }' n3 k6 A* o, A
        clone 1 load to P_induction
+ V: q& h$ ~1 `4 _, q# O# _        wait for A_time sec+ ^: w( P1 R4 z0 D
    end* ?# ]. {  c6 S% e, }' {
end& X; A! m+ G9 ~' J& ~

3 }) p: w4 d3 B% D' ]begin P_induction arriving. j& |9 S% D8 B; g
    if A_induct=1 then clone 1 load to P_pick1* ]+ E) F$ a2 }5 l
    else if A_induct=2 then clone 1 load to P_pick21 C; Z* B( T# h9 d# E& ?: Z6 X1 r
        else clone 1 load to P_pick3
# k" ]' u7 Q) e: Send
# ^* Z- _9 u  ^9 o+ M2 J- {# H' _$ B: J
begin P_pick1 arriving7 e( M* E; c0 B6 p
    set A_i to 1) T# }* {  v2 t/ i: r1 [: \: L
    move into Q_induct1: B, U* \8 R% t0 Z( u
    move into pickaisle.induct1
) s4 W6 S; o& Q+ D& ^    while A_i<=30 do begin( ^8 j* {3 V4 Y7 g# P5 C3 Z" t5 W
        travel to pickaisle.con(A_i)
" i. S' \; C& u4 l+ e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; Y- V  d9 }1 v
        else wait for 10 sec+ K) g3 Q1 _% L! y0 c  i
        if A_i=A_leave then send to die
! f9 h4 X% x( t+ s, E5 n        else inc A_i by 1
# h) V' m$ P8 h    end( F! U$ M1 w) y& N" S
end* C: X* m. N8 F! t8 n1 A: a6 c

/ `- A/ N8 w1 Dbegin P_pick2 arriving
( h: y$ W  U: R: [- f6 x    set A_i to 11
9 Y6 f! [( W, M# K7 f1 a, u    move into Q_induct2$ F  z2 R1 x& W7 X& B% o& u
    move into pickaisle.induct2  O# W7 u1 x# h6 F0 Y) p
    while A_i<=30 do begin6 b3 H( E9 }1 }# c4 W0 ?1 h$ N3 G
        travel to pickaisle.con(A_i)
& d' H* P( {: f7 T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! X8 D6 q0 j% P1 R        else wait for 10 sec( O. W( U  W+ q% z
        if A_i=A_leave then send to die% a( [. [9 I* ^) D1 `: k1 N7 r
        else inc A_i by 11 ~4 ^/ E+ p* d+ C& k
    end4 ]3 [2 W! k4 ?9 O6 @
end
5 d9 O( h. d) U+ ]3 p7 V' ]
! |9 `# o  }" T/ S: ?5 D! R  Xbegin P_pick3 arriving7 R* Y. h5 n7 n, b3 p! V' N
    set A_i to 217 i0 [" {  V( [4 l. P0 j7 {; O4 F. M% d
    move into Q_induct3
7 t( v1 }. b' M7 H0 r    move into pickaisle.induct33 O% g" N, @& B6 V/ b7 [3 m
    while A_i<=30 do begin
9 |7 Z; M: b% ?        travel to pickaisle.con(A_i)
, g! ?4 c3 |0 P0 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 u; ]8 e# v- g% \
        else wait for 10 sec) t) R" y6 W$ j1 ~& Z
        if A_i=A_leave then send to die$ R  U9 f1 ?& J& z# n! w& ^) J
        else inc A_i by 17 B1 C  S& X* U+ J
    end3 g& a7 _3 x. ~1 v7 b' s+ m
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是个什么东东?- m/ o3 M) U% r. q1 H
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 O' ?: c; U" O, B- R: v

! Q8 S; i+ D# ~5 P; p: FAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. m9 ?% X- c" T1 K1 ^: d9 Z

0 e3 I3 D" }* u9 `另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' \# L+ ?, W/ K# ~( {; }' t+ h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;7 u, s, Z! F8 H, H0 N& E7 k
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) J" W1 k2 `' S# e- K( R3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) H9 Q: O* \: p' k3 B' s+ E3 T% `& L
begin P_induction arriving
! S, ?' c6 r: k) ^    clone 1 load to P_pick(A_induct)! ]  q, W2 d  Y0 \  O8 X; k# v
end最大的系
* E1 R7 Z' s: n% L1 A% u
+ P+ G" u2 T- q, i5 wbegin P_pick arriving8 Y3 F4 d* M! h
    set A_i to procindex * 10 + 1
9 K( u. f) ?0 n    move into Q_induct(procindex)
- y1 @; Q1 Z, g: s5 ~$ F, o. c1 [    move into pickaisle.induct(procindex)
  ^6 {8 i4 g" O# ?    /*check the type of pickaisle.induct(i), for your last problem.*/
2 |+ |& L" x2 d* o, K/ Z
, y$ u  G0 k+ N) j    while A_i<=30 do begin: C6 b9 D* l# M3 W# a& i
        travel to pickaisle.con(A_i)2 }5 P3 F& c+ ?! B5 t: ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' H, ?+ x+ x& {3 Y
        else wait for 10 sec
$ b/ M3 j/ i5 l5 ^; H        if A_i=A_leave then send to die
6 P. ]- D+ v7 ]        else inc A_i by 1
( j2 x. P2 F( r    end5 ^# S7 c0 e4 m
end6 T- B8 C( D5 ^! D) a6 y- z( R2 v

9 ^, Z: i3 o9 |& S. a其中的procindex为整形,代表当前process的序号。( H: ?# Z6 {. ~9 R' N/ S
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-22 04:02 , Processed in 0.019543 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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