设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14537|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. D( u3 i7 V% ~! q
4 c, g: E/ J$ \" v: v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) T$ ?% T. @+ t. b" j
3 \  ~8 @9 L+ w/ B) u3 k4 x  Bbegin P_read arriving
% p, O: n% k, W) a1 x, M+ a+ K. C    while 1=1 do begin/ A* u+ H( T9 [' E9 g
        read A_tote from "data.txt" with delimiter "\n"& n0 ~/ j4 B: O3 b! W9 }' Y2 k: C2 R
        read A_time from "data.txt" with delimiter "\n"
9 [" C7 ?: d+ f7 ~, P  ~; e$ X        read A_leave from "data.txt" with delimiter "\n"7 f  X: V7 i* o* B7 Y6 V
        read A_picks from "data.txt" with delimiter "\n"9 O  Z7 K, f3 h8 U* \/ \
        set load type to A_tote
2 {  C5 O- d( s, J6 F        if A_tote="tote 1" then set A_induct to 1
) k) H( c: l7 t        else if A_tote="tote 2" then set A_induct to 2
% A+ g9 T  w) u  k7 \# v            else set A_induct to 3   
6 E0 `, e8 j/ v3 R        set A_i to 0  g) Z! }) D4 y, G! X
        clone 1 load to P_induction
* V; N. t- B$ [+ B2 }0 Y        wait for A_time sec% }2 ?6 y) R) }& B6 C
    end0 |- Z4 K$ A8 j; y8 u. G
end0 R/ \1 K2 L  k& D9 q: ]% ?
  c  |3 a6 d5 z8 k
begin P_induction arriving
' K1 ^6 D" ^6 N' a    if A_induct=1 then clone 1 load to P_pick1
% w* B) X5 ^& r3 Z& l' `3 e    else if A_induct=2 then clone 1 load to P_pick2# [" U4 y3 J9 C5 W& B! v
        else clone 1 load to P_pick3
5 N9 X' O! S8 y" ^* U" eend$ d# ], V) x! I3 f4 N
2 K( p; p; ?2 N3 X
begin P_pick1 arriving# {6 w2 z5 K' B# t  X: q
    set A_i to 1" K% R; b' I) K
    move into Q_induct1, @) |5 q: e) @5 A2 t: E, A  d
    move into pickaisle.induct14 d' O1 h& ~/ Z; O0 L- b; J
    while A_i<=30 do begin
: d3 _% \6 R' `8 M0 G4 ?  r        travel to pickaisle.con(A_i)9 |3 m) Z% C8 w- @. b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 M; S% Q- S/ ~        else wait for 10 sec3 _1 d* `7 G* V, Q% Y# r
        if A_i=A_leave then send to die' w# r+ z# i! N
        else inc A_i by 1
6 N: l6 K; d" M7 a7 o    end' S6 f- A6 t) ^
end
5 h3 c9 F* B3 N! P
% \9 U# f3 ?$ k* q# s! Hbegin P_pick2 arriving9 ?+ I* ?8 }! d! N$ L
    set A_i to 11
; e, Y- c+ H6 d+ f    move into Q_induct2
  E8 ]; P# V! E0 w    move into pickaisle.induct2" J8 |* i$ C( [- B
    while A_i<=30 do begin
7 L6 \: P  y7 m& N5 o" Y        travel to pickaisle.con(A_i)
4 p, H5 e9 N( o! E' P/ L* q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ]$ z/ a( Z' J* X+ T        else wait for 10 sec" g) U: B; m0 c% F
        if A_i=A_leave then send to die
) k& A( A2 O6 g: N        else inc A_i by 1
: }, m. L8 j6 M" L( r9 [0 {    end3 y) b+ d# f: N* b3 j
end  F, o+ K0 r  K2 ^0 g, E0 d
/ ]8 ?8 ^) b5 O4 O3 q& W
begin P_pick3 arriving4 [* c& k5 v) Z# z4 [' J8 p
    set A_i to 215 h7 y0 D& M+ E2 C
    move into Q_induct3
- a" d3 d  g& H    move into pickaisle.induct3
, ?' |: M  j9 i+ P9 z    while A_i<=30 do begin, p2 N) X- q- T/ ]
        travel to pickaisle.con(A_i)
# b: A) k! ?, d* Z% t0 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 N, ~" e1 D3 I  R        else wait for 10 sec- S8 K5 A  L$ ?3 p8 h# @
        if A_i=A_leave then send to die
7 o/ H7 J1 l% g( Y' o7 S        else inc A_i by 1
; \1 R5 R) B- u7 ~    end
" }$ I9 G: g% p% }: F, Vend

最佳答案

查看完整内容

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是个什么东东?% ?4 Y& H" ~( r0 E% r% j* c2 m' y
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?: l- y! r( u) D. S* d# k6 V' b
6 q3 z4 L. t- }$ O/ {( D
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ G2 o$ V' G8 ?( W2 d
% S% B% c6 T; l
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( A0 \% K, F3 }6 Y4 T4 Z, D
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& t! W8 _! [1 G& }- y8 g  ~1 W' z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
0 S6 v) L  d! d- b1 o3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 u6 {& |& N, t  y0 Bbegin P_induction arriving
; o5 a0 b- L9 J& u, M4 |    clone 1 load to P_pick(A_induct)
2 d4 J: h: U2 i5 F8 Y7 [end最大的系0 S' `& z; q* b5 V
" Y9 A) u. E! C9 A6 ^+ T
begin P_pick arriving
+ H4 n- }- @5 f; J    set A_i to procindex * 10 + 1" m, j4 k7 R* N7 [) Y, m' D; d
    move into Q_induct(procindex)
1 w" n! o- R3 L1 X& H    move into pickaisle.induct(procindex); `. p+ O( B) `; O# S8 K$ i
    /*check the type of pickaisle.induct(i), for your last problem.*/
% X5 I6 D9 y: l+ e$ u4 u( U; A( T8 R0 S* {& u3 e% m2 R8 p2 o
    while A_i<=30 do begin
' W% l3 U$ j. {2 T% ?# V, j        travel to pickaisle.con(A_i)
, P' P6 H5 {$ \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) E+ E5 h, E! M8 @, N        else wait for 10 sec
( b3 w7 c9 M* E* w( `. X        if A_i=A_leave then send to die
) D( _  N- ~7 Z. {        else inc A_i by 1
2 j9 c6 P) [9 U" Z3 j' D8 `    end
8 A% c% Y' q) `: l1 a  pend
& u. Q; z3 r9 k3 j* J( n" M0 V9 b: ]  ~3 d: ]1 a; N' \
其中的procindex为整形,代表当前process的序号。  \3 G8 {- p" V  R: o0 H0 Y% x2 q6 ~
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-16 03:46 , Processed in 2.809155 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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