设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11673|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 ^9 Q3 `3 D) N% e$ b3 U
9 m7 \! A  L* Q  m1 _# ^1 Z$ w6 k我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ O" d+ `1 ^* A5 C

/ v8 p2 F+ @, s# v* U/ |begin P_read arriving' m7 p  c) M! b1 P  X/ l
    while 1=1 do begin
- R( b; m& d* `2 ^" m9 X        read A_tote from "data.txt" with delimiter "\n"
) x& G4 i- S& b' q        read A_time from "data.txt" with delimiter "\n"
/ B1 s$ W- _" ]+ P- \% ]$ o        read A_leave from "data.txt" with delimiter "\n"
, j6 H( O! M$ S9 H2 X4 ~9 R2 F) w        read A_picks from "data.txt" with delimiter "\n"
. P8 m2 q2 Q. |5 K: B+ p        set load type to A_tote
& ~  B" _0 F/ {: ~) f, \, ]$ [* t        if A_tote="tote 1" then set A_induct to 1, Y3 y+ l3 h( \; e4 G0 ]/ N
        else if A_tote="tote 2" then set A_induct to 2
3 A) m8 Y* ]% w            else set A_induct to 3    - E8 Z$ V  m5 L  ~" [
        set A_i to 0$ }& W0 J; |/ e& I/ U
        clone 1 load to P_induction
, S1 M! G' }5 J% v6 j& d( X        wait for A_time sec
" H# q. O8 U5 p& w' b" X# Q, F    end
! }! k; Y8 y' w  _7 Send
0 d$ G! `4 k# s8 o9 I8 r8 V
' L# [( c9 D+ Q* @9 o, Hbegin P_induction arriving
& q0 C* b2 K) _! u8 U    if A_induct=1 then clone 1 load to P_pick1
8 @* U' ?8 N7 \7 z9 w9 K5 [    else if A_induct=2 then clone 1 load to P_pick26 [$ s  ?2 t3 V6 N6 w7 ?
        else clone 1 load to P_pick3
' M" S$ M$ f7 u# M8 iend( T8 ]! g. d3 O* _' j- T0 n
% o& F2 z- W6 d4 g" q& O
begin P_pick1 arriving5 A; k" i- y6 G# }+ [" W3 @
    set A_i to 11 V: Q: G# r( s$ |5 j0 V( o* S
    move into Q_induct1' u) ?: l( f1 y# |+ l0 @
    move into pickaisle.induct1  s; c) }, m# T5 O/ B3 s
    while A_i<=30 do begin
, ^8 R0 _5 P5 C6 [        travel to pickaisle.con(A_i)) |6 {# F6 g2 n" T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: c. i5 X% w2 R& L5 N# F9 F        else wait for 10 sec
; O# _# y" ^- p3 [; T( v! j        if A_i=A_leave then send to die
9 r* X$ ~# L# \# w: N        else inc A_i by 15 J8 G2 S2 h2 a/ V" N4 D. K
    end/ b: V' @% E3 Y8 N! O) w
end  [, Z7 h& g- Z7 w: |

0 L3 C8 C" h3 Sbegin P_pick2 arriving7 k: `! Q- N. ]5 {* V' r
    set A_i to 11
5 x" s7 v* l( {1 L' M. k    move into Q_induct2$ G$ U& P& r9 P& m* A( w
    move into pickaisle.induct20 u% \1 P3 W* K0 {
    while A_i<=30 do begin
4 t; v/ z% k4 c  k5 ~        travel to pickaisle.con(A_i)( i, o* c* U. e9 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' A# [; y/ w& V6 b' g
        else wait for 10 sec# L: j( [; X. a+ P" }
        if A_i=A_leave then send to die, d* Q5 H' p+ Q2 b6 X& ~
        else inc A_i by 1
( E; |- z0 s% A    end
+ Q; |) m" }) d+ M6 b( H' kend
: D! C! n1 s- g: I" D% H" n
/ o+ ~, t$ A6 R1 ~7 {, G8 ]begin P_pick3 arriving
/ \2 l. I; Y) Y% X! x$ e- V    set A_i to 21
3 N5 e, ]  D' e+ p/ o! J    move into Q_induct3
" u( p2 h. l9 n# x' W    move into pickaisle.induct3
% ~( ?  K& B: m1 h. v    while A_i<=30 do begin( X$ b# }2 q( W% ]: N/ ]
        travel to pickaisle.con(A_i)/ Q0 W) c1 Z+ g, y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& ]& f6 L, a+ p$ e3 \
        else wait for 10 sec
- p3 [* G5 @# h7 O, m        if A_i=A_leave then send to die& }. Y/ F* W) f
        else inc A_i by 1& a: l% Z0 T) K8 _9 i; C4 I& n
    end4 y5 k5 `' B8 `" h8 K! s4 p
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是个什么东东?/ ~- [! |1 s' {4 a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 I3 y: ?% k" L0 _+ V! j, B) s, y4 K) m9 N# s1 Z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 Z  Q5 ~; H2 v: Z
2 f$ E* m. T; }4 J  c$ @另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
6 J# n$ A6 _/ P1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;1 R% V( u' B2 N# o) M6 v8 o7 i
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;. b) ^- \0 w2 L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ @5 P1 ?8 p! r/ ubegin P_induction arriving4 h& l  U7 T6 ]0 R6 _2 Q
    clone 1 load to P_pick(A_induct)
+ x  A% u; o1 Vend最大的系
4 M! s' \, x6 d' X+ @( E; I3 h0 Z; Y' d8 c$ i! x
begin P_pick arriving
7 v% `5 q( _/ K: G/ d+ y! r    set A_i to procindex * 10 + 1
2 E9 j  i; ~& W    move into Q_induct(procindex)/ g; m5 w3 W4 N" b
    move into pickaisle.induct(procindex)
/ _0 ]' s6 ^! s' c5 M* s1 [4 k    /*check the type of pickaisle.induct(i), for your last problem.*/. b: Z5 r: g9 s/ |6 U; Q; b/ |

# Z- l; \+ M/ i" \5 o! A    while A_i<=30 do begin
  h: f# ~* b+ |* f, U        travel to pickaisle.con(A_i)8 C( ?! h( p; l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 Q8 M: i7 ~9 F
        else wait for 10 sec
4 @( J& ^! X  O7 p        if A_i=A_leave then send to die
6 p9 y4 I4 f3 i# A. H* b        else inc A_i by 1
/ Q  P1 g' R6 \0 |0 ^% ?' l# l2 ^4 v    end2 B: P- D4 t2 b; F" i
end3 D7 j. E) I! Z4 P9 e3 g
( d) M. R* o/ s, U: h
其中的procindex为整形,代表当前process的序号。& ^& s! {3 b! K' E# `( ~4 T$ a
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-26 22:10 , Processed in 0.015647 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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