设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13167|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& u4 ^  }# z3 E; k3 g; Q% T1 Q+ O9 I4 [7 }( N9 U. W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ c+ L& A  u4 ~) k. z9 N* D! d) Q# ^8 z' J  T7 f* F1 e
begin P_read arriving* u: u* o- p, o8 c* O
    while 1=1 do begin
1 |' I0 H+ i" o* I% x% e1 b        read A_tote from "data.txt" with delimiter "\n". O  u( B$ ~* y9 p# A# L
        read A_time from "data.txt" with delimiter "\n"
4 X; x* }( p* s" E$ K3 j3 s4 B        read A_leave from "data.txt" with delimiter "\n"
) O/ \2 H- r. c; Q5 ^        read A_picks from "data.txt" with delimiter "\n"
3 a& I* O4 O. N+ k! H8 Y4 q        set load type to A_tote
- r( n% {% x! S! _' |8 `! n* r        if A_tote="tote 1" then set A_induct to 16 P' P8 Z. t% m1 ~" S8 W
        else if A_tote="tote 2" then set A_induct to 2% m6 k) Y; t  h
            else set A_induct to 3   
( A0 {" E- N- C7 ]  T; m- H6 \        set A_i to 0. T4 C3 G2 e: E/ \  L
        clone 1 load to P_induction
/ Y" y7 n6 f1 Z# R2 V        wait for A_time sec
5 p8 ?4 P5 v- [1 }( P. r. e1 N  R" t    end# Q* o# A4 l7 t- B7 n' e/ o  m
end2 ?( D5 L0 }7 j' G0 h- Q' J

. M% e7 Y) p5 ~& F; V0 Mbegin P_induction arriving6 J( c8 L5 W+ O! ~. W( L+ D! q
    if A_induct=1 then clone 1 load to P_pick1: v, a  Y4 ^5 q/ R: a8 O
    else if A_induct=2 then clone 1 load to P_pick29 |* s4 I' D' L9 n* a
        else clone 1 load to P_pick34 I' Q/ u9 X5 D
end' {$ p: D2 W1 f2 ]8 v

' m* ^5 D1 @% Q% Gbegin P_pick1 arriving
8 R0 Z" c% V9 r5 f3 P/ r    set A_i to 1
  K  E3 O) T) d2 U1 L    move into Q_induct1
, ^( Z. N4 q# Z- ^" s2 ^    move into pickaisle.induct13 I! W3 T1 Z- R
    while A_i<=30 do begin
. M+ Y6 j  d9 g& z        travel to pickaisle.con(A_i)5 L! E/ A  _1 w: `! \6 ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 e$ c1 z% s" k, U2 l6 P1 S
        else wait for 10 sec
7 J% A4 U& v8 h( R4 E% @        if A_i=A_leave then send to die1 V) H* f" ~0 o/ Q6 l. s
        else inc A_i by 1% p* P- p! e' f! l2 S2 }. q* d
    end+ n* h, c7 i+ @
end8 d7 S9 J6 B# `1 q0 {

' x6 q8 G1 [2 }) t1 `0 V5 gbegin P_pick2 arriving8 s  h6 t& v* M9 l: S
    set A_i to 11
9 t+ R4 M( \4 V$ w    move into Q_induct2
5 i5 [( c+ S1 m1 {; T0 ?- M/ y3 u    move into pickaisle.induct2
4 Z) c" E% X( D    while A_i<=30 do begin& n# }# [4 r* Y$ @$ q
        travel to pickaisle.con(A_i)( ]% M) J% h8 [! ^( O: a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 c6 q7 L" E9 }( T
        else wait for 10 sec+ I* g9 {  S, B2 n+ ~/ d; T
        if A_i=A_leave then send to die3 @2 Q; k1 p0 A( ^) e9 F
        else inc A_i by 1
8 i# ^5 V; Q$ d4 F    end1 `# ]4 L: J# t" w( o% R6 I
end
" _) f% ^0 y9 A- x5 k; _, c, C; `5 M6 B. ~/ x' T3 `4 l, l+ s8 W
begin P_pick3 arriving# U8 H  A4 G4 D6 T
    set A_i to 21
2 I% ]. o% I5 q& U; Z. b2 ^' k  Y/ k    move into Q_induct3
+ ]1 o$ \, O3 J' z& P    move into pickaisle.induct3
' z' H: n! W: `" F6 m$ W- o    while A_i<=30 do begin" T# v" l  b# X$ X
        travel to pickaisle.con(A_i)
$ S  K1 e% y7 M+ U; z  F! D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# _8 a/ v; s4 Q, l5 j3 N        else wait for 10 sec% w/ _( q0 T0 _! L4 p" k1 |
        if A_i=A_leave then send to die# _& ]) i  A0 w8 j/ `
        else inc A_i by 1
; q2 r" E0 ?- p0 R; a" b    end: V0 y4 w5 d+ o- _& B
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是个什么东东?
, f$ U* ?! c5 \7 G8 E" c' E0 e7 wmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 d6 r- b- q5 Q$ j  G  q

( A- z' e" P2 q( ^' _$ v9 ^AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- z8 \* m: t& X. d# k; R: f: o; P

7 M) |( C; n4 u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:' v7 }+ d/ a# T
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 ~+ J7 v6 @4 R8 [# [
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 Q( B8 G' l( d! }2 t1 }" v3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 s2 x. W$ R! K( n- _
begin P_induction arriving
+ N/ ^( D, X! @' D    clone 1 load to P_pick(A_induct)- p/ }6 W0 p6 D/ m0 b
end最大的系2 x1 N/ o# g8 }) b$ N0 x& w$ y1 z
+ x. |* Y: @) v4 z" G8 p, E
begin P_pick arriving
: m  {" O6 q4 a: }+ N4 M* b# J    set A_i to procindex * 10 + 1
) e7 D8 j# Q) j    move into Q_induct(procindex)% l- T% r; l! J% ~7 J# ~- E1 s
    move into pickaisle.induct(procindex). u( B* C1 f/ ?3 t
    /*check the type of pickaisle.induct(i), for your last problem.*/+ E/ r  n+ ~6 O- x+ k

, p3 Y1 ~* D; g! V) R8 L    while A_i<=30 do begin
  o! ~0 e- r: Z9 S' P        travel to pickaisle.con(A_i)8 _7 C+ T5 T( k' e
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 N" s" d: S/ g! m
        else wait for 10 sec
! d4 c! l: C, B: V3 s  i8 T        if A_i=A_leave then send to die8 n$ H7 o5 P! G/ ]+ S% H
        else inc A_i by 1' `9 Q& v& ~% S4 h8 @
    end
  P5 ^, b& I9 Z- xend
# h2 @' ?: A" }" Q8 i0 Z( Z; h1 J5 @
其中的procindex为整形,代表当前process的序号。
* M- O5 L' x# U( g4 I; }: F1 j; M0 Gstation和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-23 17:11 , Processed in 0.015895 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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