设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13972|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ `% P# N( y- F' c/ y# ~8 {! o+ E% Z) P$ e# d$ l: [: l) 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中的数值,不知道会不会有什么不妥。! E8 m. H. z4 @( D. u

3 o; O7 n8 [7 K6 z* A6 t+ fbegin P_read arriving3 ^& m0 }2 v1 ]) R- m5 h0 ^$ f
    while 1=1 do begin' c$ v; e( q* D: m9 ^6 ~
        read A_tote from "data.txt" with delimiter "\n"4 A9 J& h5 l+ L; \$ a
        read A_time from "data.txt" with delimiter "\n"
9 R( e* O' z, @- g& V/ Q        read A_leave from "data.txt" with delimiter "\n"3 ~) m: }  q, K4 ?  P6 }
        read A_picks from "data.txt" with delimiter "\n"
( g( |5 G- C7 Q# a7 l# r: S' C( P+ p        set load type to A_tote
) O  [8 h( q' c1 F        if A_tote="tote 1" then set A_induct to 17 D' Z7 v; d7 u: J$ `( @9 [
        else if A_tote="tote 2" then set A_induct to 27 @0 ^- `* W) ]7 F
            else set A_induct to 3    + Z& d1 a$ k" G
        set A_i to 0$ K# m. @, U2 P0 O3 [
        clone 1 load to P_induction, r1 W! H+ K, n- V0 {, P& {8 S
        wait for A_time sec
4 q' Q+ s5 M; K8 E    end
4 t% Q. Z0 _6 ?: t) t5 s  Kend
1 o" o! R3 n, O& P2 T/ p
" Q( M6 c+ D' {& tbegin P_induction arriving, }0 R) l, N% p' f8 `. \: R
    if A_induct=1 then clone 1 load to P_pick1
8 `- z1 w9 B$ t+ y5 a$ c: k/ Q3 }5 o    else if A_induct=2 then clone 1 load to P_pick2
4 s; r# U( i7 F' ~7 A4 j        else clone 1 load to P_pick3  t  L5 N5 R- Y2 t3 u
end1 T3 c0 I- F, X: Q- p/ X
- b; \3 s( C. K- T
begin P_pick1 arriving3 q+ ]  B% w" e
    set A_i to 1
, k, {& S+ u4 m3 P2 h" M' Z    move into Q_induct1, ~: f7 {7 K; x4 B6 j# X7 K
    move into pickaisle.induct1( L0 M* O! M% S% N
    while A_i<=30 do begin: r8 |; T9 p4 m9 i
        travel to pickaisle.con(A_i)
5 v3 |/ n1 z' K! z* }* H* i: l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' E: c1 T' j  \5 V) d: P3 @0 W
        else wait for 10 sec$ Y4 `0 V# p+ R' [  r7 _
        if A_i=A_leave then send to die& r& R: V0 ]# w. }
        else inc A_i by 1  v* V+ R* U9 j! e
    end
7 M$ L% Y! ]( n. mend
. }. j( d- J" ]2 l% N+ }2 a1 Q: w7 ^8 ^, j) y) ?, {
begin P_pick2 arriving
8 w6 S% Z5 M- `3 Q    set A_i to 11
5 x! o8 z4 F1 S, Y3 y4 X    move into Q_induct28 M6 j3 M4 t4 U
    move into pickaisle.induct2' E* T5 j7 `0 c0 K" W1 x# }
    while A_i<=30 do begin
. M' o: Z) b; H) t( t        travel to pickaisle.con(A_i)
: ]' V, Y+ M3 K- t" l  s        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 S6 H& }+ a7 R6 g* V! F/ O  u! n, i6 p
        else wait for 10 sec1 {. e$ b8 R1 i, ]$ V8 O
        if A_i=A_leave then send to die& W( Q" `( J; h( |# }+ O
        else inc A_i by 1; I, B& g2 R/ [# P
    end
% f+ w! y$ E* j) y6 w6 a( yend) C+ y( R3 h9 W- Z6 c

/ y: `+ l  M- r% Hbegin P_pick3 arriving
- u  t8 N6 W; U+ I    set A_i to 21
6 v2 T# E' L4 q    move into Q_induct3# N, N4 k: v+ n2 ^
    move into pickaisle.induct3
6 V/ p' v. E# T    while A_i<=30 do begin
- M* j- X" t* O% K) b        travel to pickaisle.con(A_i)
! G$ M4 {4 ?4 Y. Z& i' S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ]9 D6 ?, {5 K$ a6 D# m
        else wait for 10 sec
- P" M. n8 W$ h! v/ U7 x        if A_i=A_leave then send to die
, r; Z& l3 y) @' {        else inc A_i by 1
: @! O$ V1 T8 \( @; m$ c% h. u1 f9 y! x    end4 w5 q) [/ Q' ]# r% O. m% O; q
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是个什么东东?- d; w% S, K# V; I% ?* r+ |. b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ V+ S! [  [5 v" R# @7 f, @  j7 u& h6 `& u
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) y' E- n+ V9 Y

  j# M2 l4 G& S2 H* D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  T2 V8 q: _' l: j7 j6 `1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% ?) ~/ n8 {6 Z# `5 J1 L' N# z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; Y4 h5 i  r7 E4 G) k1 R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. u6 f! C5 m- z' A
begin P_induction arriving
, O: C1 R0 g; ]7 ^/ Q8 w5 W& @    clone 1 load to P_pick(A_induct)
2 w0 v3 ?+ U* N/ lend最大的系
% a, T* t2 y8 N5 y* D4 o0 z+ [+ V& U, J) g5 Z4 D  ~# U8 ]( {- [
begin P_pick arriving
; O2 m- G$ U# t9 ]( ]; v7 s( Q    set A_i to procindex * 10 + 1
' [7 b- f& [( x    move into Q_induct(procindex)
* t* Q: x: X- I$ }; H    move into pickaisle.induct(procindex)
0 |# B8 C8 W( C* @' w2 s$ X8 ^    /*check the type of pickaisle.induct(i), for your last problem.*/3 q5 w9 v. H+ ~- r' @5 O
* ?& q! p! V( K; X9 ^
    while A_i<=30 do begin
% Y' V( Q$ g! \. r" ?; c: c4 _        travel to pickaisle.con(A_i)4 I6 @, e4 @. T7 J8 B7 a3 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, k0 S9 ~+ I1 }4 }. M$ d        else wait for 10 sec
( |6 J- K0 ?" X( w! G1 t- c        if A_i=A_leave then send to die, ^6 l# H: V# @3 f1 X5 g) C3 Q
        else inc A_i by 1
/ j1 c: R- S5 v    end
- E( L0 ]( j/ u; T9 X0 M* t4 Pend
' K- V- C) f6 f8 z
/ b& ^9 p/ g& s7 g其中的procindex为整形,代表当前process的序号。
$ H* H; W# ~$ Gstation和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-5-26 04:06 , Processed in 0.016550 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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