设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11744|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 F6 H( s' J8 @* b( I
" T! u3 X  A' X6 Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。: Q3 V% r9 H. q
% F4 u5 U5 j! F7 S* f, p) G% @
begin P_read arriving
, M# {) e5 ^& s1 ]: I$ x1 p& w    while 1=1 do begin  {6 r( Q6 @' Z% v
        read A_tote from "data.txt" with delimiter "\n"9 q) g8 K( p. r" o- Z: s
        read A_time from "data.txt" with delimiter "\n"
2 m6 e$ v  `2 O& q1 O- K( g9 Y        read A_leave from "data.txt" with delimiter "\n"% p7 A6 K- c2 v: ?; j& [
        read A_picks from "data.txt" with delimiter "\n"
; L6 C: g: x2 Y& n. m/ R        set load type to A_tote
0 u0 ^9 ~4 e, P& {! B5 t: R        if A_tote="tote 1" then set A_induct to 1
9 i  \; @' X: Q0 I- }# K5 O        else if A_tote="tote 2" then set A_induct to 2' G6 o* ~$ ?3 q) m# p
            else set A_induct to 3    ' J- Q3 \  j! O. p/ G
        set A_i to 04 J: p9 X: P) P% z, Y" S9 j
        clone 1 load to P_induction
$ S& A) J) |9 o: z1 D$ M        wait for A_time sec: c# b- |% l' `$ M  w
    end% V" R/ {5 r" Y4 C& ]+ _* L
end8 h: s* z. a3 y8 k, h! o0 S2 l

& _+ O0 M1 ~. ~5 _" i) jbegin P_induction arriving
% s5 A, q! i, ]$ o; ?1 S$ k8 I    if A_induct=1 then clone 1 load to P_pick1
0 D/ x! `0 q1 E( x    else if A_induct=2 then clone 1 load to P_pick2
; q( t: o7 h( b( c        else clone 1 load to P_pick3) Q& t" s# U8 v( [- d
end( r& ]8 r6 @# Y$ q, ^

7 ~- {# a8 G+ |2 y- i& N% Lbegin P_pick1 arriving
! _+ U" i+ c# Q$ P    set A_i to 12 d$ ~# F. `+ k
    move into Q_induct12 X- I/ ^! q! T* h
    move into pickaisle.induct1: S" b; H* c5 W* I/ ~
    while A_i<=30 do begin
( w! e0 w4 N6 S- ~# a        travel to pickaisle.con(A_i)
: h; G  L. {5 c& P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ~. Z3 [7 P; X; u        else wait for 10 sec
* e/ ^0 N! K6 K* V! D        if A_i=A_leave then send to die# F3 t2 i9 M) Z  q; O3 ^
        else inc A_i by 1
) G, s- I9 z% J. T    end7 l4 A1 W, P" Q
end
% W/ S- L5 t+ @# P7 i2 {3 M+ K7 o2 N; A' G0 c6 M
begin P_pick2 arriving
5 g4 o2 b: A9 k    set A_i to 11  f0 P' }, a0 C( t  Z9 g
    move into Q_induct21 s! z6 C4 k& k1 [) _
    move into pickaisle.induct2
6 d% d* B! J. m) _0 @1 A$ }6 ^    while A_i<=30 do begin
  M- l, X& O+ [4 e' m: d* }        travel to pickaisle.con(A_i)
9 J/ r+ X& Q' P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. m$ `, D1 V/ O7 t; K        else wait for 10 sec
- k5 O9 ?" ]( i7 W; e& J6 s4 D) [        if A_i=A_leave then send to die
" W* y; q' G3 O3 k2 _0 Z# g        else inc A_i by 1
# ]: j7 o  w/ d. N$ n3 t# R    end
9 K7 Y* s: u; H8 Q' Iend; c2 Z- d1 W$ I5 u6 N( A$ V* ~7 ~

8 v" X7 I) b: cbegin P_pick3 arriving
8 A, |3 |- g9 M  h  s* E4 b; b! }    set A_i to 21
/ j  l. e# ]4 z  k$ O" D0 j4 a6 G& _    move into Q_induct3! K" V- {% `8 m' e) A2 I6 u; q
    move into pickaisle.induct3! _1 n1 [" V& f% K
    while A_i<=30 do begin) Y" x  `/ b2 c' E6 y, O5 ^2 F
        travel to pickaisle.con(A_i)" F# P) t  X6 o, _" q& Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, d% m9 |5 W* C$ }* Z        else wait for 10 sec
+ z; W6 N. i* r' U8 {        if A_i=A_leave then send to die5 f1 o- U. b! u; q! F9 I
        else inc A_i by 1, ^& V) w/ v& k/ b, A9 P
    end
) M: h* V2 @: ]0 }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是个什么东东?  K. s( e& C* @. T8 b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( K* [7 |, {( L, K) Y; |; D! J' V5 F& m1 u- A
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% P- n6 Y5 I( A* d
! f$ B/ _% l5 f1 k4 l) D. N
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 u, O4 v, o1 p0 U1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 Z* s: ?8 `# e; S% C$ M2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& [  H8 }& k. M3 O
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:4 {0 K' J: B4 t- A
begin P_induction arriving
# G. o( ~' }  o* i+ R( G$ C/ f& D    clone 1 load to P_pick(A_induct)( p+ B' O9 S: k4 H* Y% X9 _
end最大的系
8 b- W, D" A6 K; ^& N  E% U6 a9 F7 L9 m2 J. N0 M0 j5 h
begin P_pick arriving
2 Z! K. Q& L: y2 {# y! `    set A_i to procindex * 10 + 1
9 e  }4 W# H: S5 J$ J6 ?    move into Q_induct(procindex)
# f9 I7 b  z; V) _    move into pickaisle.induct(procindex)
5 O! H4 x' N9 F( b, ?    /*check the type of pickaisle.induct(i), for your last problem.*/
/ |( ?6 T3 d3 `/ }
4 z: g3 Q' Y1 u9 j7 \    while A_i<=30 do begin( I5 w, g/ [* j
        travel to pickaisle.con(A_i)
8 G: q: V% c7 h3 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% [/ h" Y6 J$ u& @# F7 b        else wait for 10 sec
  N; s4 x" _! }( r        if A_i=A_leave then send to die+ O8 ~! A8 Q5 @* A! P
        else inc A_i by 1
- ~) K$ B, s( m& m1 a    end) k& s% W9 `7 C' ]8 Y! }; E) d: T
end9 r# h, @+ y, m. J) w
* X: q5 j7 S0 k3 A7 x
其中的procindex为整形,代表当前process的序号。
2 F% J3 X  S: O+ hstation和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-12-2 02:11 , Processed in 0.016147 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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