设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13732|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 X% Y3 C6 c8 ]: x+ L3 `
8 k) l4 D) {5 I* y7 z我的问题是,在每个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中的数值,不知道会不会有什么不妥。' s: s, a* Q  S5 E; I. e
: {4 m( R4 }; y, e) i. {
begin P_read arriving
- i5 J& j) x- o" F2 M! H+ S    while 1=1 do begin
4 m% N& c. i( |7 w) l( l  n        read A_tote from "data.txt" with delimiter "\n"5 L; x) X) ]! M# _2 _  r! u
        read A_time from "data.txt" with delimiter "\n"! r. `' d" u  h+ p" i$ j# Q2 K" m
        read A_leave from "data.txt" with delimiter "\n"
! R- Y7 ~2 c& s8 B: Z        read A_picks from "data.txt" with delimiter "\n"
8 V, M' w$ \1 H        set load type to A_tote& @; {* w* s) P/ f8 r( i9 Q  s( `) [: r
        if A_tote="tote 1" then set A_induct to 1) V2 |2 V9 K* w4 H' y
        else if A_tote="tote 2" then set A_induct to 2
9 T$ V% S# d. A. a/ F2 a            else set A_induct to 3    8 d  T% F! l9 G- b2 ^6 {* C; \' [% e
        set A_i to 0
1 {2 X# {! ~' F! T9 X8 w6 X( S        clone 1 load to P_induction) q, G1 d+ t; D7 P6 M6 b
        wait for A_time sec6 G) t& d7 [, \7 q( Q, ]. K, E* i
    end( d& g1 G5 _5 K- _
end# p3 x8 \% m3 h$ W: G$ @; Q8 P* `% D
  @7 T6 W  f1 O' J5 p* T( x2 N6 d; W
begin P_induction arriving
8 a7 \$ \' |- R+ T+ p! [+ O    if A_induct=1 then clone 1 load to P_pick15 L' r: v% g( ?# S/ c7 P
    else if A_induct=2 then clone 1 load to P_pick2; e) @2 P- N7 `  {2 B  i: U" g
        else clone 1 load to P_pick3. i8 B* M7 o7 }
end) d( w7 X! Q9 }# u+ M( J
% [7 q$ O( J0 y8 z
begin P_pick1 arriving8 f$ H* V3 v7 z  x: o
    set A_i to 1- e( }4 o2 O, G- C3 i. _
    move into Q_induct1
; B. A8 \! Z+ ], o& D& }    move into pickaisle.induct1" U& o' l& y  a( O! }! @" i2 H
    while A_i<=30 do begin
& p  w1 \7 V8 e; Y4 ^        travel to pickaisle.con(A_i)) W- {6 Q! K: `& q$ W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& j. u% l9 C1 V5 ^* D        else wait for 10 sec/ m2 c, K) p$ u! A) V7 w) N! x
        if A_i=A_leave then send to die3 I1 i6 O% K; ?( \0 C
        else inc A_i by 1
$ n5 D0 g2 G; w, g8 I0 s0 ]4 p3 }  {    end
; n  h, r* `+ _( Lend$ i' |/ M; w$ L) l1 y& G( w
0 Z( o5 T: ~- R0 x* _" H' z- u
begin P_pick2 arriving4 x$ g$ ~5 R# `3 \( s  k4 y8 ~0 u
    set A_i to 11: u& F4 A7 `% f3 h2 j/ o3 q
    move into Q_induct2, S$ c; |' u) J1 G* n- X
    move into pickaisle.induct2
2 ^  I. N' S# i; j$ ?    while A_i<=30 do begin
+ t4 S% C6 |* f4 Z" ~# I        travel to pickaisle.con(A_i)
! p0 ]/ d* m* D4 f7 d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& d4 j$ i% z7 J/ `  b  n
        else wait for 10 sec
: o( T* [) y3 Z" u, e9 B) Q        if A_i=A_leave then send to die
1 N% W- U% [9 \; u9 r        else inc A_i by 1
1 ~, S+ l# A( F( u# R    end! o& m% B4 @3 @; F
end9 i4 w' }3 i6 c5 E. P' i* }  T: o
) ?! I; t0 x9 C5 A8 p% e
begin P_pick3 arriving
% T  _# \* L& T/ G* K. M1 {    set A_i to 21& Z1 Q- x# ~# ~7 I/ M1 k2 |
    move into Q_induct3
* t# [" X! i! Y    move into pickaisle.induct3
" g1 y9 N- B( r6 S; h. P& Y4 J    while A_i<=30 do begin+ ^/ z" O( w3 \5 d
        travel to pickaisle.con(A_i)
; h1 H  D# k9 I& O# h        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 B: P3 G1 |5 t2 F- l
        else wait for 10 sec
; K1 q4 s: |0 O: Z' Y4 Y% t& `' E# X3 c        if A_i=A_leave then send to die8 L" K3 t( _8 T7 I8 W+ G, g* Q
        else inc A_i by 1& i: {- v" T$ R8 r' D/ b$ V
    end$ B1 T7 h& e4 f" J8 }
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是个什么东东?
+ G! ]' K, p  R' P+ k# v' mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& F) c1 `+ M, ~- G; Z3 g
* L& _6 N* e2 _- Z; j* IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。5 r2 h1 ?1 N9 v6 R

: s: n" P: }9 ]另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" c, c. t4 C3 R) ]' H& b+ J1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 l" G) r; U) \; n' k5 R8 v2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 k1 d. r# @% \4 e# j3 g1 d3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
2 S- H& t$ K* ~: \5 {' O! Fbegin P_induction arriving
8 `: ]. o0 q& H5 \    clone 1 load to P_pick(A_induct), C7 M, K( [2 `5 L
end最大的系; T: e2 q9 X, {, B% S
2 m5 ~0 }8 M& n4 [
begin P_pick arriving
. L0 W& ^* c( m: D# l0 [    set A_i to procindex * 10 + 17 B9 T2 ?% P# {" g
    move into Q_induct(procindex)
* V. L$ m  @) L" j    move into pickaisle.induct(procindex)
6 l, C- e7 w' i! z9 D2 P8 u& z    /*check the type of pickaisle.induct(i), for your last problem.*/5 j! s; i/ o7 M3 F
$ b0 R5 o' `4 I0 J
    while A_i<=30 do begin" \4 U! O2 q; b
        travel to pickaisle.con(A_i)! ^8 S0 A( V  H7 ^/ V0 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' D/ _* F' O$ b$ L9 `
        else wait for 10 sec8 w1 B* d  O. C! w: c
        if A_i=A_leave then send to die
* t% q$ M* q; T* h; _0 u: A        else inc A_i by 1
6 r# O# {* E: p    end( K) b/ Y& A3 F0 n
end
& S/ L( p( L& E! F% g! h, M9 M3 Q9 y  }  }' g
其中的procindex为整形,代表当前process的序号。
  _2 W5 F% w9 _7 }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-1 18:06 , Processed in 0.015531 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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