设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14263|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ r1 n' M/ @# ]* \3 Z+ B. \, k

$ L, l5 z( s+ R' v, o3 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中的数值,不知道会不会有什么不妥。
; @* ?1 P1 a( _% Y
5 t0 r' c1 |) U( E! G: _begin P_read arriving$ V7 E+ n* F1 ]7 ?0 y
    while 1=1 do begin! ]9 ]% j& r$ g. @
        read A_tote from "data.txt" with delimiter "\n"
* _/ q0 T9 i4 R4 O. J# v        read A_time from "data.txt" with delimiter "\n"
9 |* Q1 X8 E7 y  {! S( E        read A_leave from "data.txt" with delimiter "\n"9 }, _- R- h' ?% L) W
        read A_picks from "data.txt" with delimiter "\n"( f+ @2 x& y4 e1 V# C8 t
        set load type to A_tote
; p* m* m8 s& u: D" G: b; `        if A_tote="tote 1" then set A_induct to 1
; \$ v/ ~* |7 ~" z6 e) s: N        else if A_tote="tote 2" then set A_induct to 2
3 j) Q7 S1 E$ [            else set A_induct to 3    4 f2 R+ `/ `" W% L
        set A_i to 0
) ?, a# `- L7 f. p0 Y) h        clone 1 load to P_induction
  o, Z% A# j: t) |( Y4 L        wait for A_time sec
1 x1 d6 ^0 F! s4 r! s) o    end3 Z/ L0 \" c' Q: g- C
end
4 X* ]) Q/ ]/ X5 Q+ E; k0 q  y; J5 B; |4 x0 J% b' D
begin P_induction arriving7 K. c1 ^, m; S9 Y6 f  G
    if A_induct=1 then clone 1 load to P_pick10 u! U, B. g& _4 S; e* j
    else if A_induct=2 then clone 1 load to P_pick2
2 r5 {3 }! A3 V! e9 O9 c( B        else clone 1 load to P_pick33 S- b* Z+ {& `/ d/ G
end
# {. Z" |6 L/ D; d- e* q  P8 b7 V# R: e+ \
begin P_pick1 arriving2 J8 x4 l* j4 N: n; t
    set A_i to 1. B% f8 e, t+ s! p. S
    move into Q_induct1
: ?. f# r3 |9 V! h5 n7 G( v    move into pickaisle.induct1
, W6 |3 y2 d- ?0 \0 n    while A_i<=30 do begin7 X3 Z; T3 `  ^+ p7 q. W
        travel to pickaisle.con(A_i)
3 s/ d( w8 y1 y3 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 @: O2 _0 x2 ~3 [
        else wait for 10 sec* G% o  ]. [9 v7 Y
        if A_i=A_leave then send to die
* z* R9 s- p& j4 g* l        else inc A_i by 1
! n) k1 |# q  G* }& c    end
- m% c) T* q( Z9 H' ?' v# uend0 r; R( k! F5 Q, p7 I
4 \' X) _- d: x$ t: J- a
begin P_pick2 arriving
0 m+ f0 }0 }+ s* V! r: \$ P    set A_i to 117 \  q9 `5 N: K* _: Q" O6 u  H& @- G
    move into Q_induct2! C9 X) r- h2 o" E% M$ f
    move into pickaisle.induct2' s0 a* {: R' u
    while A_i<=30 do begin: w1 O) H1 {1 x' [; P
        travel to pickaisle.con(A_i)1 @+ `7 P5 h3 h0 d+ O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Y) F9 {. ]. [  A" m
        else wait for 10 sec
$ M& E( e9 f* `: A8 G8 d4 L" U! f% I        if A_i=A_leave then send to die
9 ?! s# T0 J# l/ u3 A! Y7 T        else inc A_i by 1
. G6 {7 _1 V: d, z$ ^    end1 H# {$ w0 F8 {! a, S' j, K3 @! z8 `
end4 ~, q, D  t  q( e

: j4 `7 }! c+ u& x, y# l+ Tbegin P_pick3 arriving
+ h5 m0 n' h; ~+ q    set A_i to 21
2 o% H( x' k& y) A* `; W    move into Q_induct3- H4 H2 w9 |/ I# Z& O/ U' F2 X
    move into pickaisle.induct3/ w& l4 e" S0 M8 z& m$ p
    while A_i<=30 do begin4 C0 |9 q+ S; f
        travel to pickaisle.con(A_i)
+ \; }0 f- O, R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% x- S! s" b& d3 S4 W
        else wait for 10 sec. ^+ f: L, d7 g5 O! O5 N. ]1 }1 ^; G( U
        if A_i=A_leave then send to die* r3 p" Y6 Z" n' C6 ~
        else inc A_i by 1' `/ l' e0 J+ h+ @0 H9 [
    end' s) T$ M/ J8 ^0 }8 @
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是个什么东东?
% m0 H' K5 k+ y" ]# U. D) w0 Z6 ^move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
* `" Q6 v" A/ ^) u5 G+ C# a/ `: n+ W9 J8 V+ b
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
1 K5 u. B0 o4 ?, ~& v
0 ]/ P+ M: F. x7 q( b0 ?另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: h7 A# d) J5 U: z# i  K' y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 z$ D! z" j( u% d& N! g2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) `4 ~! t5 m% x3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 \( e! H' S0 [# X7 }# [
begin P_induction arriving1 D% v- Y& n' W% w) N
    clone 1 load to P_pick(A_induct)1 N3 Q9 W- r1 j3 B, `1 s- f" \
end最大的系. f" Z# `8 Y- a
/ D* h% E6 }: Q7 [1 [% n6 z3 u0 |7 e
begin P_pick arriving
( z! F( F3 N! H, `% x. L! R# x% W    set A_i to procindex * 10 + 1$ r5 ~- M5 H  u4 Z7 f' I4 H
    move into Q_induct(procindex), ?4 B' Q$ j/ x' X9 z
    move into pickaisle.induct(procindex)1 k6 v; ~6 D! x, t$ w
    /*check the type of pickaisle.induct(i), for your last problem.*/
$ R9 v* J# W. ~
, Y% H5 }8 }/ u6 y    while A_i<=30 do begin7 t7 Y! ?# g, Y. n8 f3 I% _
        travel to pickaisle.con(A_i)
( t; u/ l, p: L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, {) \8 d2 d9 ?. V
        else wait for 10 sec
( S$ ~$ g% @+ M! c2 ]/ k        if A_i=A_leave then send to die
# O7 o5 x" b! @1 G- e' g        else inc A_i by 1
# _& Y- a! F' |    end2 s- X2 W. c0 I) K2 w" |+ e! u
end4 }$ c5 q  m5 q: h

4 e7 a9 a+ E* Z8 |0 f! ^9 F其中的procindex为整形,代表当前process的序号。: D3 s" q5 _# h* h/ s( K
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-6-26 07:17 , Processed in 0.018066 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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