设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15001|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, }+ K2 r( C+ F; X
  G$ g  F  [) E8 x* V2 K我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 B2 a: w7 U4 K8 X- F+ @

- _" y5 ]% q6 U$ R8 }6 _begin P_read arriving1 M1 z! |) c, v
    while 1=1 do begin
& h' s$ `2 k0 H8 m* _( ^5 o2 D! a        read A_tote from "data.txt" with delimiter "\n"
, q" B8 I3 V( w' @8 b. X        read A_time from "data.txt" with delimiter "\n"0 F' d8 s, \, r; T7 ~* |/ M5 C2 X' z! u
        read A_leave from "data.txt" with delimiter "\n": \5 `+ q/ S3 X% S" m" F
        read A_picks from "data.txt" with delimiter "\n"
1 g8 R% U. w$ T. M        set load type to A_tote' _. f7 _$ b- H; e
        if A_tote="tote 1" then set A_induct to 1
( ]# A# m' s  O        else if A_tote="tote 2" then set A_induct to 22 F+ f  v2 m/ X5 k# T* {+ I
            else set A_induct to 3    / d9 x8 W: r+ h2 d8 \. A* z
        set A_i to 0
" m( P8 C) k, V( S! G        clone 1 load to P_induction: \& N: {! T; j; g6 V( s
        wait for A_time sec
# s0 g" A* K7 t    end: L' ]9 O9 `# Y* }# Y: o1 w) E
end
( U4 W& p/ x1 ?: J
6 Z1 t0 m% A, @& i% Y8 W# qbegin P_induction arriving
; u, j3 N/ f8 Y& m    if A_induct=1 then clone 1 load to P_pick1
# S; `1 D4 H0 P$ _; R( Y8 p    else if A_induct=2 then clone 1 load to P_pick2& b% S( |, ~7 @, L
        else clone 1 load to P_pick34 M: L2 ~/ M4 e2 M. W7 F, ~
end* c9 E+ g6 p2 Q
% s& \/ z9 m) X/ j1 @- t0 F' C
begin P_pick1 arriving
0 ~' v6 H4 R; ^% G" J! n    set A_i to 1; R6 s  v& b7 i+ {/ Z0 L
    move into Q_induct1
" A( v, H; J0 T+ L- j    move into pickaisle.induct1& r" X$ y7 X$ K4 S" l* M! I
    while A_i<=30 do begin( u; X5 I% S; f8 g( d- |
        travel to pickaisle.con(A_i). ]7 S, U( ~& k# Y" }0 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 y$ Q! j" m( m6 |& f9 {
        else wait for 10 sec6 b% s5 l8 ^7 M" S& G# O/ C
        if A_i=A_leave then send to die
" ]4 P* K. C% F        else inc A_i by 1
0 t, f  H) U0 s    end# z+ i4 S1 c. }+ a
end
! i5 K4 b3 m* F. q; G* I2 s- s9 f5 Y# i: r$ r! J5 N% P
begin P_pick2 arriving
& D4 k$ d/ R, f8 F, O    set A_i to 11
% J% Q& |5 @5 D9 z7 A- v/ w    move into Q_induct2  l" d8 n9 q7 K, F0 W- g9 s
    move into pickaisle.induct2
  A- H% w: I) z/ E0 Y$ u6 P; {4 p( d    while A_i<=30 do begin
, G- i9 {  W. i& P3 I        travel to pickaisle.con(A_i)
! e5 w2 G. o+ [# ^% p* z* }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ t! S% j6 A& S+ Z! n" Y  R
        else wait for 10 sec' D) j- Q, f- S
        if A_i=A_leave then send to die
7 F9 L$ v+ }. O2 ^( M! ~        else inc A_i by 1
7 w7 g  }/ l+ K; N+ z+ D    end: h- q% S. W# L
end; l2 E4 Y9 {( K' r% F

1 R; y# @9 c1 g( z5 [2 hbegin P_pick3 arriving
! r$ k7 l; x. V! p; D) ]" P2 o    set A_i to 21
' w% z. Z# z9 g    move into Q_induct3
0 Q+ W/ E# I: E) U  `    move into pickaisle.induct3% x& a1 `9 Z  O" G5 Q9 b
    while A_i<=30 do begin
1 S9 C8 ~' T( l% w        travel to pickaisle.con(A_i)% T- n' r! \. y. k7 ^1 x8 @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 [( q; H% I% R2 Z- ]: w$ |3 R        else wait for 10 sec  Y, Q0 q5 c! l0 A
        if A_i=A_leave then send to die/ F# J& @! J# H0 C) `
        else inc A_i by 1
% }5 k' O$ L3 n. B7 o% s    end
- I( g* S9 D8 \5 p& _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是个什么东东?- N* Z- z+ b- `! v. v  c
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% A8 V' l$ N, l2 s' ]9 A: z. C5 S
- f* b2 s/ p- P" n( h* k$ vAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
8 G- f% h* Q" L, B+ O$ y0 a/ p' I% I/ c4 }& C$ u% d
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 l# }, {  E( `+ F' y
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
; i. u# s) ?; E4 C2 l1 q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& r3 b; N$ f( p' [; D
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, X; \7 q  L8 R, |) Y+ U: _1 z$ `+ c% Y4 U* Z
begin P_induction arriving3 K5 Q( G* K- Y0 W; |5 d7 ^
    clone 1 load to P_pick(A_induct)! \3 ?. z0 y5 i$ y
end最大的系# s  i9 E9 m3 |" P2 l0 a

/ k% d3 o1 f) }5 S9 C7 v7 s8 Rbegin P_pick arriving  Z$ {- ~8 S$ a! c- N- V
    set A_i to procindex * 10 + 1/ A  a4 i* w  J
    move into Q_induct(procindex)
3 q# V( s. z5 [( E; {% L9 }# Z    move into pickaisle.induct(procindex)
$ v% m! d3 A: c' Q, J: T7 ^! C0 Y% \    /*check the type of pickaisle.induct(i), for your last problem.*/
, i- c4 j& q" T" x
9 {# Y: o6 G' \0 K  P5 Q    while A_i<=30 do begin
% V5 i, f0 o. Z# z6 v3 M8 L        travel to pickaisle.con(A_i)- v3 O# d) J$ m% q' r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' }. F' }0 t! p! F, v' k# [0 v        else wait for 10 sec7 Y3 p( C. y1 a, E
        if A_i=A_leave then send to die% H& v8 d: v. K
        else inc A_i by 1
9 p3 I5 i0 V$ |0 l+ r    end+ g' X3 m. L. ~4 }
end: Z* x# B& n% i1 W

- v  S% }6 ]: ]  Y& P9 c其中的procindex为整形,代表当前process的序号。
- H. E# _. H, z3 @5 F) y8 Bstation和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-8-3 07:31 , Processed in 0.015464 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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