设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14576|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( W+ L7 O! U% S' u, m0 I& |
! W- O1 p3 g3 }5 I" u* ]% U我的问题是,在每个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. T. j$ G: j! b% b9 G2 H# ^$ i" J* ^6 [- ]3 h) D) f
begin P_read arriving4 ?. r$ f$ ]0 m% o/ {0 ?, O' S* D
    while 1=1 do begin3 V; X# @  u+ `# r
        read A_tote from "data.txt" with delimiter "\n"
5 j3 E' H1 u3 b; T) P        read A_time from "data.txt" with delimiter "\n"% b+ x/ _, K/ u7 K; A
        read A_leave from "data.txt" with delimiter "\n") ~! Z4 F$ y+ N9 y: J
        read A_picks from "data.txt" with delimiter "\n"
4 X* a! Y+ _1 A' ]        set load type to A_tote
5 U8 N* t& a4 G        if A_tote="tote 1" then set A_induct to 1
/ T% M. y7 M: K5 g' D        else if A_tote="tote 2" then set A_induct to 2
$ X, D8 d0 a" |- C0 l            else set A_induct to 3   
, \7 m% E& N/ O        set A_i to 0
6 e* O  H4 H& }1 w  b        clone 1 load to P_induction0 k, f2 A+ D' a- g# I
        wait for A_time sec
* `: R3 r9 p5 Y) r$ b. a6 s- I    end7 s+ i. x5 f) ]* A, R
end
2 g4 e$ ^( P3 V" i
4 @9 V3 }3 L2 C, Y& pbegin P_induction arriving; G; j6 A1 j; Z! S! k
    if A_induct=1 then clone 1 load to P_pick1
* _- Z' u0 ^& T( @& @* q    else if A_induct=2 then clone 1 load to P_pick2' @: j6 S0 ~: {6 d- w
        else clone 1 load to P_pick33 C8 I$ i- \7 z$ Q) L# M1 Q
end- R  Z' z* a& n# {6 H
3 p( F( Z$ ]7 _7 D8 j2 a0 q
begin P_pick1 arriving
; O5 n; G9 \6 P, `* T( q: Q    set A_i to 1
% y# B2 i% A3 M, i/ R( N% z    move into Q_induct17 G) g) \: m) J6 T/ p
    move into pickaisle.induct1+ A, \  a2 h/ s. }( M. X! A0 u
    while A_i<=30 do begin5 C; }& F1 Q4 t- u2 _2 c
        travel to pickaisle.con(A_i)
# M4 U* b! T, H- D. u, x/ L2 Z' {  K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 w% n. o5 L3 s' Q
        else wait for 10 sec- X4 J$ O4 ?* h( N
        if A_i=A_leave then send to die- T# e% a' n, e. g; f5 I  r
        else inc A_i by 1
3 N& }' O0 O& t$ u6 J, Z    end4 Y: Q+ `) y6 t1 Z+ }, d7 o
end
4 V3 Z# G. h. C. s: V: q! _4 x' N- B: p% }" W7 H
begin P_pick2 arriving
4 V1 }# U: w) Z& I. _( g5 h) I4 K2 ?    set A_i to 115 A. z, ?% t2 c) M9 A
    move into Q_induct2
* j! M1 v) v7 X, y3 Z/ o, A: ?# a    move into pickaisle.induct2
6 g0 L5 `. W# `/ @; V  O    while A_i<=30 do begin6 y5 t  z- l% P3 g7 K/ g! M
        travel to pickaisle.con(A_i)" N+ B: o% w" Y: s4 E9 Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% g  T6 w" N6 p3 e0 q+ g& ]# k
        else wait for 10 sec: r9 k, p" n, H/ B5 E) ?& m9 d! O
        if A_i=A_leave then send to die( W' K) G9 }( z2 r, A8 F
        else inc A_i by 1! I" @' c: u$ {/ q
    end
8 I& R' {1 n4 d8 V& Uend
( c4 S, i( _: ~) n) W' W! l$ j
9 c- S& N: q/ Q) y7 N; o% `begin P_pick3 arriving
' c9 b' @# ^2 K3 R    set A_i to 21
* l4 q; i+ z( ]. l8 R6 Z    move into Q_induct3
* [9 E. X# ~& u$ q( M0 j    move into pickaisle.induct3' v" `' i7 B/ d* f, _
    while A_i<=30 do begin# h) k" q3 M: ]7 E
        travel to pickaisle.con(A_i)* n0 U2 ]1 S# Y7 h0 e  g2 x* t  W1 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 r+ G9 }7 J, `% ?/ W, X        else wait for 10 sec7 Q! R  \& V" _" x6 ^: P
        if A_i=A_leave then send to die6 I. |* Q% i; w- Y8 q9 X
        else inc A_i by 1" S2 N: B! n, e
    end
/ m" r2 q5 M( }9 yend

最佳答案

查看完整内容

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是个什么东东?/ @  R4 `' R: W2 q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  [7 ~8 H' {3 `1 ~8 |
$ d0 v9 K9 F% q. ?% oAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ S+ [5 x; Y( K6 g* @# w

( L* X0 R& a2 j另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. Q/ O; m* y3 @! r- Z9 b! T/ ^1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ }7 \' c3 {1 M" i# [# w. w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3 }6 F5 @4 p$ w% G9 c, S9 Q$ y: y& v3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) H, O5 s* t' x8 L/ @' B
begin P_induction arriving0 b& j- w+ Z3 D' \' p0 L
    clone 1 load to P_pick(A_induct)
# }/ I& `; I7 S6 L& Mend最大的系( q, M/ @+ M( N' Y/ ~6 p8 I
' R- z  ~+ }3 }6 b7 g* ^
begin P_pick arriving
% n7 G/ L- ?1 W0 u7 g' \( ~    set A_i to procindex * 10 + 1
% \1 t3 F; X6 ]( Z; P    move into Q_induct(procindex)
( x/ B" w8 W& Z3 _% D, i* A6 I    move into pickaisle.induct(procindex)5 J# w0 P$ }7 D: [
    /*check the type of pickaisle.induct(i), for your last problem.*/
  x8 f; I4 O/ ~% d9 c" m4 s' i3 M2 J! [; D* Y# h8 s
    while A_i<=30 do begin
" G! P$ P, R7 f( E& z& K. f+ n        travel to pickaisle.con(A_i)
4 m: K3 E; I+ c/ m1 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& R0 f- T- X. @& d2 ?9 q        else wait for 10 sec( R( B+ Z9 u3 W$ j, Q: q
        if A_i=A_leave then send to die( I, A4 P: K& U2 P# ~
        else inc A_i by 19 d. f% C2 E2 }
    end) I4 ]7 `& N; h; X: P: T' S
end3 v; K: Q8 }- N! p  }: d
) Y" J" L) ^5 Y" @& K
其中的procindex为整形,代表当前process的序号。; T/ q# G/ w4 v( }" C* }6 s' m' J. U
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-7-17 18:54 , Processed in 0.015221 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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