设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15441|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& l. O+ O; a3 c! Z5 [4 p  s& L( E* ~9 ]$ k! D; d0 |9 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" b7 {' j# I! N* \" ^9 |, M" e8 v" D2 T, X: t; _
begin P_read arriving" \( g  O8 m2 y! ?
    while 1=1 do begin
; B0 A! @3 P" i& E2 X" ]        read A_tote from "data.txt" with delimiter "\n"; u5 L6 Y& }( N5 d6 i/ U% _
        read A_time from "data.txt" with delimiter "\n"0 ^5 a3 s5 l( p: V
        read A_leave from "data.txt" with delimiter "\n"4 |8 [+ z0 W3 a$ P( ~" I) h
        read A_picks from "data.txt" with delimiter "\n"! x& J) b2 D" O/ F: h  [
        set load type to A_tote
9 l* @0 {( q1 X- u% W- U( S        if A_tote="tote 1" then set A_induct to 1
, E% U9 C# h( g  J+ J        else if A_tote="tote 2" then set A_induct to 2
+ ^) a8 v  ]( O- u            else set A_induct to 3    1 V2 X8 o9 h' k7 G& H
        set A_i to 0
3 w( \; i$ q; R3 ]+ s9 R6 I        clone 1 load to P_induction' D+ ^# F0 m) {4 S2 |
        wait for A_time sec" `" [- P. `3 t& U
    end+ @! z7 ]% Y: V4 F2 O' J2 W
end' m4 s' R3 I) h" \/ g: S2 |8 L
, y+ F' f$ o6 x" q$ Y
begin P_induction arriving
0 n  C% G* }) R2 d9 ~" Q! z9 q    if A_induct=1 then clone 1 load to P_pick1
2 I6 |! g5 Z7 C+ b. I    else if A_induct=2 then clone 1 load to P_pick2
: x- {# v, f5 h9 |$ T: z0 z        else clone 1 load to P_pick39 f2 p1 Z2 o) Q- K& j# q7 c7 ?- p
end' G: ~+ f( T5 c% B0 T/ V' R  y; u
5 K9 b: N  f% W& G/ N" V) O
begin P_pick1 arriving, J  u* `2 R% Y4 ~/ U
    set A_i to 1
9 D& M9 `0 O! |6 a: c    move into Q_induct1
) `3 {8 |4 K+ r) h! X    move into pickaisle.induct1. `. n  z  `% j1 L# i5 g1 ]+ w" ]* L/ E- ~
    while A_i<=30 do begin9 b! b* T; C/ b& |  G; h& |' _
        travel to pickaisle.con(A_i)1 K6 H' `7 Y# d% ]$ r. ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) U/ I( H5 a" T/ \        else wait for 10 sec
2 T$ Q7 t) q, j+ L/ g3 L& y        if A_i=A_leave then send to die6 T! ^& X. h& R1 S- h3 X
        else inc A_i by 1
8 ]- \" B+ y3 G3 d    end
: `/ H% ]9 N- b6 |end2 i! [, N, H) Z0 o' K! {
& `) @- C& P0 q- P! d5 R5 ^+ _
begin P_pick2 arriving
# v3 z8 x4 d7 p8 W2 n    set A_i to 11
! I8 |) c6 s0 b) X    move into Q_induct2& g% R+ e4 h9 h6 I. G9 }
    move into pickaisle.induct21 o4 H. \6 P- s
    while A_i<=30 do begin3 b8 P/ c* Q" X; Q) W& t, N
        travel to pickaisle.con(A_i)/ Y" I' Y2 P3 }" _. k" `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. [) z6 A( M" g: o3 f( t' d        else wait for 10 sec5 i3 F& E% r5 Y4 B" t3 x; N
        if A_i=A_leave then send to die  f8 D; Y. j$ j) H
        else inc A_i by 12 q' G& S# T  O% |# e
    end
4 e2 q3 R+ @$ {end" Z2 E) y" E5 E1 i9 L# W

" z. ?8 c( ^& nbegin P_pick3 arriving8 b1 L  }& Y% a- d
    set A_i to 21
7 M) k8 \+ h$ M( Y    move into Q_induct3
0 r2 }* Q; g1 S. p- r; J    move into pickaisle.induct31 B. N1 x! j% z- J
    while A_i<=30 do begin
5 F, z, i" t3 c6 M' [        travel to pickaisle.con(A_i)( Q, d. M7 i# N6 x
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: h4 u2 a0 Z% h- g7 A        else wait for 10 sec
) ]* S. J/ C/ K9 m9 O* ~2 ^% h        if A_i=A_leave then send to die9 z% m7 v; D; t  L  n
        else inc A_i by 1
& \- p- e. [! V( g) E. [7 V- O' u    end+ o: i2 ]& J* V, U' v
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是个什么东东?5 l7 T3 p. M/ J; z+ x- P9 b- S
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?2 ?) w/ J- ^' p  o+ R+ J. M

* n1 q3 A: z7 _/ ]0 Q% [AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* N. |% s' d2 ?! `  ^2 l1 l

9 y. K% Q6 B8 [0 E( Z另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 W; Q: a, @( b+ p0 g7 r+ C' X1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% |3 N- D+ u; c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. f  `/ e0 H1 @) J3 [6 C3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( z4 M. ^+ J* K3 {* M- Gbegin P_induction arriving
( A8 g) Y% ~; ]& p! C$ o" K. u    clone 1 load to P_pick(A_induct), h  D7 w* T0 c' N$ Q
end最大的系
/ G/ M! Y% ]* `' y2 D1 n6 k* d7 ~, f
begin P_pick arriving: U) @1 _/ p0 w( I: v6 w. h
    set A_i to procindex * 10 + 1% D- H  X6 q- Q; g( F: J0 H
    move into Q_induct(procindex); s, w" K) P: k6 v
    move into pickaisle.induct(procindex)9 n# P  h3 A0 X  a4 g: }# R
    /*check the type of pickaisle.induct(i), for your last problem.*/
% g% S9 J- L: N' x, W$ c* v: p0 {4 g
1 P- F+ ^1 N, D+ g    while A_i<=30 do begin
& x2 W2 C% |5 S/ H( M6 L5 a4 \! a        travel to pickaisle.con(A_i)
9 h4 ^9 c7 q* ^: q9 j3 D        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; Y3 j+ ^0 o8 z
        else wait for 10 sec
- f2 G; r4 o5 w4 i6 b* g        if A_i=A_leave then send to die
$ O9 I. B9 q5 I) {  l        else inc A_i by 1% _$ i8 P0 h* G) f2 E
    end  L9 _9 t$ B: X% P2 [
end
/ d1 G* S# [, q! J5 I8 e& D2 \0 z* Y' `
其中的procindex为整形,代表当前process的序号。
: B$ h! @; m8 e: _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-9-11 00:47 , Processed in 0.020706 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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