设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15410|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( P4 S6 n  @( @1 p8 g3 d5 z3 g% k7 |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ h, z6 P0 _5 X- x
! I8 g0 V( ]& k& [" V' r
begin P_read arriving
8 d% M( n( u4 n" ^1 O9 C* G    while 1=1 do begin
, l" R" y( C) x8 o$ M: b+ c        read A_tote from "data.txt" with delimiter "\n"  m4 b" l8 E$ D' ]
        read A_time from "data.txt" with delimiter "\n"5 @. O& B# M5 ^0 V; Q+ R. u
        read A_leave from "data.txt" with delimiter "\n"- D6 ]( f0 }+ w. ]+ X9 R) I
        read A_picks from "data.txt" with delimiter "\n"
, {' ^- I1 f  f) [- A8 E6 i        set load type to A_tote
( M0 A/ Y0 X; b! I! {        if A_tote="tote 1" then set A_induct to 1( D+ g1 y( B( V3 Q- r
        else if A_tote="tote 2" then set A_induct to 2! ?* v0 ?! Z+ e4 M/ ?) `1 I* A
            else set A_induct to 3   
0 h4 {+ c% I8 u, o3 H' B        set A_i to 0
  v2 E7 ]5 I) M3 y1 y: `        clone 1 load to P_induction: w; T* M* I* y9 Q# Y+ n' \" X
        wait for A_time sec+ N6 U0 H. x7 ]. s
    end' t  D2 X# t+ D3 Z+ D. J
end4 I9 X* B9 J  a6 I) n

+ ~1 P# j( S( \. p) D9 @7 U: [begin P_induction arriving3 v8 C+ R+ j5 ?- \/ D( Y0 V; r
    if A_induct=1 then clone 1 load to P_pick1( M3 d' W3 ^' j4 e* n# t
    else if A_induct=2 then clone 1 load to P_pick2
. K6 P8 Z% t7 _2 Q        else clone 1 load to P_pick3$ t9 Z* @! x+ M3 n$ t  q. v
end
5 i# ^) ^; w% O" l2 k. s) Q. q1 v$ [  z( |% v; }; U6 ~6 V
begin P_pick1 arriving+ I2 _$ h; W, ?. {$ N( [, |. }( [
    set A_i to 1
$ T% L9 B* c4 U' c. _; h    move into Q_induct1$ m, P, G5 t: P
    move into pickaisle.induct1
1 X* Z! g. {; p- B/ Z    while A_i<=30 do begin
5 V, a2 c2 u0 `: o6 x        travel to pickaisle.con(A_i)- {- Y# @( J8 S- t9 q0 ?  k7 ], ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 h; C+ ~( L; |- p' }4 E        else wait for 10 sec$ t* @" G: V; p, ^
        if A_i=A_leave then send to die
2 j# P5 i8 i# F/ ~- Y4 h        else inc A_i by 1( f3 e, N, N  d- e0 ^
    end
' ~+ B! `3 }, s" Q% g  F7 uend
" I) y0 _2 s9 N' m# C. @9 I& O# S  w
begin P_pick2 arriving+ c; B& P: s2 C8 o( Q! H& B
    set A_i to 11
" P% G# h3 w9 d4 h% [$ M    move into Q_induct2
( k0 g; l; [  `! Y2 T3 ]5 |    move into pickaisle.induct2& L- K% r/ b8 r& j0 w* s) c6 a
    while A_i<=30 do begin
" l2 \3 e9 {/ ?4 C6 q  m        travel to pickaisle.con(A_i)
9 U- y, o0 K+ q4 h$ k        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) l0 o3 @. F2 [: t$ S
        else wait for 10 sec
' U  V9 k7 _/ O/ i6 [2 g. s* X9 L        if A_i=A_leave then send to die
& x& o: N. z# ~9 W3 y6 n        else inc A_i by 1) R& t8 ?" U' V* _1 j- e- x, i" F% H
    end8 W2 m: B0 |9 n+ R) S& j) a: O1 n* z
end
* ]* z+ N+ x- v! X# ^
$ `4 I" d2 f+ W9 Q0 y1 ybegin P_pick3 arriving
  a% w5 u0 K" W+ Y6 c, x    set A_i to 21/ ^+ q3 C/ u* H8 g  o0 q
    move into Q_induct38 m% {# g- B# z6 R8 t" v
    move into pickaisle.induct38 N* V2 \4 N" i" A  [+ O. }4 E
    while A_i<=30 do begin
: |6 P1 S% m: T. [- h        travel to pickaisle.con(A_i), H1 X; I7 E! Z: f" I* t
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% h) w7 q$ O, a5 |8 {
        else wait for 10 sec$ _# M7 l- L$ o
        if A_i=A_leave then send to die
+ b3 h+ t( K+ H: [        else inc A_i by 1/ L; q% o$ ]! k1 ^; w  i
    end
4 T# ]/ x5 p. K1 r/ Bend

最佳答案

查看完整内容

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是个什么东东?& @* t1 Y5 ~- K2 ~
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( \+ v% H2 f* k1 a! Y

# n6 i# @1 O5 ]8 i1 OAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. @, Z- n! r% W* a0 K7 f' Q- D: j* S

; B% y# \7 M+ M5 u8 g7 u0 t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, `8 o* p' E0 K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  G+ |( B1 p! M5 K" P( I- o2 t9 p2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 e" |+ n6 C( K5 c( L5 V3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
+ n, f: U9 Z% x8 z/ Z/ E( |& Obegin P_induction arriving# O+ C! O+ S$ \; p
    clone 1 load to P_pick(A_induct)' d8 g5 O: W( F. V
end最大的系
" A# d  k7 |. e$ v8 r1 C. f& ?% l" z" Z. {, T* w- P: U
begin P_pick arriving$ Z7 K0 z$ v8 ]; I+ c; K$ r
    set A_i to procindex * 10 + 1
7 U% @. P9 A  V! ^8 {! {    move into Q_induct(procindex); N. h) A) V2 ~! M7 f, e9 T9 d
    move into pickaisle.induct(procindex)
2 j( _% k. p, Q4 R    /*check the type of pickaisle.induct(i), for your last problem.*/! T$ M  X& n/ K

. y% w+ c3 }& q! p7 a' }    while A_i<=30 do begin
8 A3 _6 N4 r, T" G6 X: x7 h        travel to pickaisle.con(A_i)$ ?5 w/ w, N) c) N) g' J+ T1 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' p/ b7 V% F) ^" `        else wait for 10 sec
5 q; R# y) L- _+ L, Z        if A_i=A_leave then send to die
: |5 }) ~7 c7 m8 t6 ]8 b        else inc A_i by 1# @  @& m  A2 b( r
    end* R8 |* V9 o0 P
end
$ F# m5 k+ Z+ v: w: s4 v% F4 i* y( z& f
其中的procindex为整形,代表当前process的序号。- O. a$ m5 j* a' I# N& \3 q& Z; D/ w
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-9-9 13:17 , Processed in 0.015113 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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