设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13643|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% ]  E6 C4 G1 ~' y! S, Y7 H
8 e( |" g' b/ J2 T# X( j) d  d我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 ~7 p* T% ^! V' M2 L( f2 A
0 {" \( d2 y" N8 U1 N5 j8 K
begin P_read arriving
% m% H' }7 F, i/ n7 ]; ^" d    while 1=1 do begin
, `& C3 n2 {- A        read A_tote from "data.txt" with delimiter "\n"
& Z( T0 p2 e  H/ Y        read A_time from "data.txt" with delimiter "\n"5 t7 @6 |% Q  u8 E5 b% s
        read A_leave from "data.txt" with delimiter "\n"
' v7 r  g9 Y- \% ^. A  ~# B- I" f        read A_picks from "data.txt" with delimiter "\n"
0 ]5 \0 f, F3 ~. X- v# u* u        set load type to A_tote! B( Q7 ~% d* p2 ]
        if A_tote="tote 1" then set A_induct to 1
3 I5 X! e* K; J; D" m        else if A_tote="tote 2" then set A_induct to 2
% {, Q2 G' |" {! F" K# I/ U            else set A_induct to 3    ) X# u: {, p5 y0 a1 b8 m
        set A_i to 0
$ O* |, O7 B1 h7 I1 g( k( O        clone 1 load to P_induction  j/ j6 |$ u  P  d
        wait for A_time sec) x& M; e, E4 g" X$ z' j; @1 S
    end, P) V$ m7 }" D+ e8 ], V3 E
end9 R) J% p9 |$ `% W* r+ t1 ?+ S
3 L: S0 ?+ y: c# ^
begin P_induction arriving
; j5 K4 n5 J1 V& [    if A_induct=1 then clone 1 load to P_pick13 J* J/ I0 m+ L8 N1 O8 l" \2 ~
    else if A_induct=2 then clone 1 load to P_pick29 A1 A; q% |! U) J
        else clone 1 load to P_pick3
* _% _! R$ u. Y3 y# y3 X. c# K8 |end
5 z! h: E- v  S! ^6 P+ A  a
  n0 Q, |. i- \* Bbegin P_pick1 arriving
: s, U& o7 T; e4 U    set A_i to 1
( y+ v7 k9 ~. \    move into Q_induct18 x0 a, M2 z; l9 D! [
    move into pickaisle.induct1( E% ]8 w/ |8 n* D
    while A_i<=30 do begin- Y6 Y4 G# n$ [5 e
        travel to pickaisle.con(A_i)! |5 v! {/ N  z  g3 V- \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 G2 V: y9 g$ W0 e0 Q        else wait for 10 sec
0 Y' [4 i) ~6 d8 J/ ~! ^        if A_i=A_leave then send to die
/ p, n" M7 Y6 E7 I$ j5 Q: M        else inc A_i by 1- \. G: W& D" G" J
    end
" C: c7 H8 F' U6 g( C6 N  |end
* e+ {3 D8 k% X; `/ Y, i" B9 w* V7 G$ s5 j# x' C( ?
begin P_pick2 arriving5 v) z; \; T! v5 t" z; I# ?- x7 N- r
    set A_i to 11
) `' |$ ^7 w+ K3 D6 G* L! E( l2 C0 j    move into Q_induct2
, ]2 s$ ^3 {! f; B) U    move into pickaisle.induct20 S  J/ l/ t* K8 H8 F, V% r
    while A_i<=30 do begin$ B0 O6 G! D2 S
        travel to pickaisle.con(A_i)! H- q- P# H2 a& ^9 q# S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 v6 x3 S* D: _. [& ~1 O" F) u
        else wait for 10 sec
7 X' P) p! Y4 f, i# `0 Q# `2 j        if A_i=A_leave then send to die
  S7 J+ Q5 ]! L$ n+ D        else inc A_i by 1& H1 @" {& n7 N( ?' F7 R+ E
    end
1 S0 ~3 L7 \% {) k5 d6 x( T1 u) S; uend
. |0 F% Z1 P/ w8 E! i  E) Z8 i6 o5 O3 ^2 S
begin P_pick3 arriving
( ^1 W9 h* L7 G8 e+ f    set A_i to 21# i$ K- u% @; ]) i% I/ s: Y2 V
    move into Q_induct3
- U. p5 v; s* u5 u    move into pickaisle.induct3/ @# I6 `4 S( J8 s% ~9 E3 i
    while A_i<=30 do begin7 R8 w. b! i' Z& F0 S5 B
        travel to pickaisle.con(A_i)
/ n/ a/ m( n( ~# Y+ n  D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! G  d0 H- L  {4 d, p        else wait for 10 sec
4 }9 }, s1 {0 {4 h- T. F  y* l        if A_i=A_leave then send to die2 v) H' ^) v1 _
        else inc A_i by 1: W! R; b+ D2 j
    end- ?- g2 |. ^0 z) u  P7 [
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是个什么东东?
  c6 I4 J( c: }- s$ q, Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' K" ?$ p% Q( ]4 b2 k% l1 z' I

6 {) T% [+ I7 p  r. RAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
0 U% g! i5 b  Y* B- Y+ H% U0 J2 t/ c! X* B9 D8 X
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 {- t" o4 V" T3 C1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 G( r: e7 ]. P# P- J% d2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& s8 Q% X3 E$ ^& [$ m- c& l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
9 m% i* ?& {0 F, kbegin P_induction arriving. v2 n0 L* G7 e6 w, V) \
    clone 1 load to P_pick(A_induct)* @( f; R8 H; b/ p
end最大的系* X- L; I4 `  j

8 t6 Y4 U$ w1 T% Ybegin P_pick arriving: O. }) _" y6 o( O2 ^9 C
    set A_i to procindex * 10 + 10 i  W' F( T) t! B; E* \- L
    move into Q_induct(procindex)
# ?; K: a4 c/ A# {; l    move into pickaisle.induct(procindex); L# T: {+ |+ I/ D; N2 k
    /*check the type of pickaisle.induct(i), for your last problem.*/
; I+ t1 ]. `& E3 q9 |7 J5 X% W9 {+ Y' m  p
6 ]9 y! Q* p0 w) E' w, |# ~    while A_i<=30 do begin
0 S& z: `: l, i        travel to pickaisle.con(A_i)
7 D' S# i5 D% n* y, @8 x' c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% U$ r7 i7 k  u
        else wait for 10 sec
! c) r, E5 V8 Z2 q        if A_i=A_leave then send to die* C9 I6 D% N) h! J- q0 n4 c% H4 E0 Y/ T
        else inc A_i by 1! ^1 n+ m1 w3 S) B; o- z. J  U
    end
% @$ d% W# W! ]! v* u+ `end, q# e4 N4 A2 y8 r7 y( o' p
0 a5 y0 W6 o" A7 l/ F
其中的procindex为整形,代表当前process的序号。
+ h5 w6 I! n' w) L7 s5 X8 c) p# d9 Ystation和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-4-25 21:02 , Processed in 0.016267 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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